JQuery UI Part 6: Membuat Modal Dialog Dengan JQuery UI – Pada tutorial jquery ui part 6 ini saya akan membahas tentang salah satu widget yang paling banyak di gunakan di jquery ui. Yaitu cara membuat widget modal dialog dengan JQuery UI.Modal dialog merupakan fitur pada website yang berbentuk pop up. Modal dialog memiliki banyak sekali manfaat. Modal dialog dapat kita manfaatkan menjadi. Pemprograman dasar database merupakan komponen utama yang ada untuk dapat membuat suatu aplikasi berjalan dengan penyimpanan.Oke, kita dalam kesempatan ini akan belajar bagaimana membuat fungsi edit, tambah dan edit di bahasa pemprograman PHP.Ini adalah fungsi dasar yang terlebih dahulu dipelajari sebelum lebih lanjut belajar PHP dengan fungsi penyimpanan yang lain.
I'm calling a jQuery 'GET' on the test.php file code below.
I'm trying to get the script to pop a 'Save As' dialog on the resulting test.ini file to allow it to be saved locally. However, although I can echo the result back to the jQuery fine, I can't seem to pop the 'save as' dialog.
Update: Thanks to the solutions below, I just changed my $.get to a window.location.replace.
3 Answers
You can't get an ajax request to show a 'Save As' dialog, but what you CAN do is insert a hidden iframe element in the page, then set the source of that iframe to the url you want the user to download. Voila, there's your Save As.
Here's a copy and paste example:
You don't need an AJAX for this. Just navigate to the php in question and in that php use
This will pop-up the 'save as' dialogue box and you'll remain on the original page.
An AJAX request can't spawn the file download dialog. Consider instead opening your download target in a new window.