Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery load() function won't load remote page, but works in preview mode in text editor.
    primarykey
    data
    text
    <p>Basically, I am trying to fetch remote content when people click the link. </p> <p>It works in Coda HTML preview window, but when I test the html in real browser (Chrome / FF / Safari), it won't work, the remote content won't be fetched. ( I am sure jquery is working, as alert('url is ' + url); pops up when I click link)</p> <p>It is wired. What is wrong? </p> <p><img src="https://i.stack.imgur.com/fixiR.png" alt="enter image description here"></p> <p><img src="https://i.stack.imgur.com/rDUEM.png" alt="enter image description here"></p> <p>My code as below</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;Sample&lt;/title&gt; &lt;link type="text/css" href="http://localhost/jquery-ui-1.8.20.custom/css/smoothness/jquery-ui-1.8.20.custom.css" rel="stylesheet" /&gt; &lt;script type="text/javascript" src="http://localhost/jquery-ui-1.8.20.custom/js/jquery-1.7.2.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://localhost/jquery-ui-1.8.20.custom/js/jquery-ui-1.8.20.custom.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { $('#links a').click(function(e) { var url = $(this).attr('href'); alert('url is ' + url); $('#content').load(url); e.preventDefault(); }); }); // document ready &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;ul id="links"&gt; &lt;li&gt;&lt;a href="http://google.com"&gt;Google&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://yahoo.com"&gt;Yahoo&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;div id="content"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Thanks for any help.</p>
    singulars
    1. This table or related slice is empty.
    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