Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Answering to your question of "the source code doesn't seem to change...", that happens because your browser loads the html that came from the server in a DOM tree, in memory... </p> <p>DOM from Document Object Model, is a tree containing all the nodes in your HTML including the ones, and every time the browser finds a script node it executes it's code and keeps parsing so he can build up the DOM (this is the typical process of parsing a page).</p> <p>When you do a mouse right click and pick the source code of the page you will the the HTML that your browser received, not the processed one.</p> <p>To further understand what I'm talking about, the try to open your simple example of writting to a <p> element with google chrome, and after that open the Developer Toolbar (should be in the Tools>Developer Tools) or just right click inspect over the new introduced text.</p> <p>You will see that the things you did via javascript are now present in the DOM, that because the Developer Tools will show you the source code based on the in memory DOM object and not based on the source code received.</p> <p>To get a response from the server without refreshing the page just do a $.getjson (<a href="http://api.jquery.com/jquery.getjson/" rel="nofollow">http://api.jquery.com/jquery.getjson/</a>) to a page on your server that returns your response based on some querystring parameter.</p> <p>Note, your server page can be you current page, assuming your page is called myform.php, you can do a $.getJSON('myform.aspx?action=getfieldvalue&amp;field=customername', callback), then in your page you would have something like this:</p> <pre><code>(in the Page_Load event or in the top of your page for PHP) if(QueryString["action"]=="getfieldvalue" &amp;&amp; QueryString["customername"]!=null){ Response.Clear(); Response.Write("{name:""" + DataModel.GetCustomerName(QueryString["customername"]) + """}"); Response.End(); } </code></pre> <p>The above code is just a draft, parameter parsing considerations, alternatives for page callbacks and optimizations were not taken into account.</p> <p>Hope this helps,</p> <p>Regards.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload