Note that there are some explanatory texts on larger screens.

plurals
  1. POConnection between jQuery and HTML
    primarykey
    data
    text
    <p>There are two files, html and jquery. I want to know if possible to connect between these two files.</p> <p>jquery-test.js:</p> <pre><code>$(document).ready(function(){ $('#inputForm').submit(function(){ $('#inputForm :text:not("#submit")').each(function(){ var input = $(this).val(); var someData = []; var weblink = 'http://www.google.com&amp;callback=?'; // just example $.getJSON(weblink, function(data){ $.each(data.results, function(i, item){ someData.push(item.json_Tag); }); }); }); }); }); </code></pre> <p>and the HTML file is below:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;meta http-equiv = "Content-Type" content = "text/html"&gt; &lt;script type="text/javascript" src="jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="jquery-test.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form method = "post" action = "/result" id = inputForm&gt; &lt;input type = "text" name = "input" id = input&gt; &lt;input type = "submit" value = "Search" id = search&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>The process is below:</p> <ol> <li>User key in some word in the text area and press button.</li> <li>The jquery will link to "weblink" and catch some data.</li> <li>jQuery return these data to HTML file.</li> <li>HTML file redirect to /result page with these data.</li> </ol> <p>But I don't know how can I do the process above ? I don't know how to return the data form jquery ? I don't know how to let HTML redirect to other page with data .</p> <p>Thank you very much.</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. 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