i'm newbie,i want change my DB data from jquery-ui dialog. What code should I add to the dialog script that can make me connecting to process page before connecting to DB?
相关问题
- How to fix IE ClearType + jQuery opacity problem i
- jQuery add and remove delay
- Include empty value fields in jQuery .serialize()
- Disable Browser onUnload on certain links?
- how to get selected text from iframe with javascri
In your jquery-ui dialog you should have let say a button, and when you press it, it would update a row in a database table. In order to do it:
-Create a button, and when pressed it would trigger an ajax request to a php file:
-In your php file you would have a script updating the row in the database table:
This is a really simple example, I would recommend reading the following tutorials:
http://php4every1.com/tutorials/jquery-ajax-tutorial/
I am not sure you understand the question you are asking. Javascript can't directly modify data on your server, it needs to invoke a PHP, C#, Perl or other script on the server by passing data to it. This server-side script then modifies your database.
If it were PHP your Javascript might make a POST request containing:
name=Dave&phone_number=12345
Your PHP script would then use
$_POST['name']
and$_POST['phone_number']
to access that data and send it to the database. I would recommend some background reading such as: Dynamic-Application-Development-Using-MySQ or Web-Application-Architecture-Principles-Protocols or PHP-MySQL-Dynamic-Web-Sites and jQuery in action