Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery ajax call not working with relative and absolute urls
    primarykey
    data
    text
    <p>This is the code, I don't get any alerts whether, error or success. That ajax call returns a json map, and that map is populated in the <code>select</code> options dynamically.</p> <pre><code>&lt;body&gt; &lt;script&gt; $(document).ready(function() { var selectValues; $.ajax({ type: "GET", url: "http://59.163.254.24:4287/wap/retrieve/hanset/data/", data: APP_002, async: false, success: function(data) { selectValues = data; alert("Details saved successfully!!!"); }, error:function (xhr, ajaxOptions, thrownError){ alert(xhr.status); alert(thrownError); } }); var $vendor = $('select.mobile-vendor'); var $model = $('select.model'); $vendor.change( function() { $model.empty().append(function() { var output = ''; $.each(selectValues[$vendor.val()], function(key, value) { output += '&lt;option&gt;' + key + '&lt;/option&gt;'; }); return output; }); }).change(); // bonus: how to access the download link $model.change(function() { $('a#download-link').attr('href', selectValues[$vendor.val()][$model.val()]).show(); }); }); &lt;/script&gt; &lt;div&gt; &lt;select class="mobile-vendor"&gt; &lt;option value="motorola"&gt;Motorola&lt;/option&gt; &lt;option value="nokia"&gt;Nokia&lt;/option&gt; &lt;option value="android"&gt;Android&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;div&gt; &lt;select class="model"&gt;&lt;/select&gt; &lt;a id="download-link"&gt; Download &lt;/a&gt; &lt;/div&gt; &lt;/body&gt; </code></pre> <p>Why it can't it send the request to the server, I'm using logs in the server side. No request there.</p> <p>The page url : <a href="http://59.163.254.24:4287/wap/download/" rel="nofollow">http://59.163.254.24:4287/wap/download/</a></p> <p>Ajex request Url : <a href="http://59.163.254.24:4287/wap/retrieve/hanset/data/" rel="nofollow">http://59.163.254.24:4287/wap/retrieve/hanset/data/</a></p> <p>I used both <code>/wap/retrieve/hanset/data/</code> and <code>http://myhost.com/wap/retrieve/hanset/data/</code> as the parameter for url in the ajax method, both are not working.</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