Note that there are some explanatory texts on larger screens.

plurals
  1. POwindow.location.assign("link"), is not working
    primarykey
    data
    text
    <p>Here is the javascript code.</p> <pre><code>&lt;script type="text/javascript"&gt; function myfunc() { var filmName = document.getElementById("mysearch-text").value; alert(filmName); if(filmName == "parker")  window.location.assign("http://www.google.com"); else alert("hello"); } &lt;/script&gt; </code></pre> <p>If I enter any other string I get an "hello" alert and If I enter "parker" the page "<a href="http://www.google.com" rel="nofollow">http://www.google.com</a>" wont get loaded. Why is this happening?</p> <p><b>EDIT</b>: Ok as someone mentioned I did remove "<a href="http://www.google.com" rel="nofollow">http://www.google.com</a>" and added "<a href="http://stackoverflow.com">http://stackoverflow.com</a>" but it did not resolve my problem. And I cant even load local html pages that are in the same directory</p> <pre><code>if(filmName == "parker") window.location.assign("index.html"); // also "./index.html" or ./index/html </code></pre> <p>Even this is not working. What's wrong</p> <p>I also have jquery libraries: that is Jquery UI and Jquery</p> <p><b> This question needs more of info I think. Here are the final edits</b></p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8" /&gt; &lt;!-- Other style and js libraries, including Jquery Ui and regular jquery --&gt; &lt;script&gt; $(document).ready(function() { $(".youtube").fancybox(); }); // end ready &lt;/script&gt; &lt;script&gt; $(document).ready(function(e) { $('.tooltip').hide(); $('.trigger').mouseover(function() { /* Rest of it, which is not necessary here */ &lt;/script&gt; &lt;script type="text/javascript"&gt; function myfunc() { var filmName = document.getElementById("mysearch-text").value; alert(filmName); // for debugging if(filmName == "parker")  window.location.assign("index.html"); else alert("hello"); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id='mysearch-box'&gt; &lt;form id='mysearch-form'&gt; &lt;input id='mysearch-text' placeholder='' type='text'/&gt;&lt;!-- Input here guys --&gt; &lt;button class = "none" id='mysearch-button' onclick = "myfunc()"&gt;Search&lt;/button&gt; &lt;!-- press this button after entering "parker" --&gt; &lt;/form&gt; &lt;/div&gt; &lt;!-- Rest of the HTML page --&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    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.
 

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