I know we cannot communicate with sqlserver using jquery “directly” but I want to know about the indirect method
I am working on a project with the following scenario
-
a jquery script which is installed in the browser and when it is installed and the user opens a web page and hovers the mouse pointer over an image the script runs to check whether the image has an alternate text or not.If not it will tell the user there is no alternate text and a dialog box will open(which is a div in the html)
-
the dialog box has
*textbox
*cancel button
*submit button -
now, in the submit button’s code I would like the code to send that text into my database.
I heard somewhere that we can transmit that text (from the textbox as entered by the user) using ajax to an aspx page on my website
But i dont know how
here is some code for convenience to understand the scenario
also there is no Id for the buttons,only classes 🙁
Cancel:
function(){
$( this ).dialog( "close" );
}
$( "#dialog-form" ).dialog({
autoOpen: false,
height: 300,
width: 350,
modal: true,
buttons: {
"Send your proposal": function() {
var ID=this.id;
//alert(ID);
});
ON the aspx page you can add a webMethod like this.
then you call this with jquery ajax functions like this