Note that there are some explanatory texts on larger screens.

plurals
  1. POAjaxpageloak with Hash(#) with exception when have number(Ex.: #1)
    text
    copied!<p>I'm using this code:</p> <pre><code>&lt;script type='text/javascript'&gt; $(document).ready(function () { //Check if url hash value exists (for bookmark) $.history.init(pageload); //highlight the selected link $('a[href=' + document.location.hash + ']').addClass('selected'); //Seearch for link with REL set to ajax $('a[rel=ajax]').click(function () { //grab the full url var hash = this.href; //remove the # value hash = hash.replace(/^.*#/, ''); //for back button $.history.load(hash); //clear the selected class and add the class class to the selected link $('a[rel=ajax]').removeClass('selected'); $(this).addClass('selected'); //hide the content and show the progress bar $('#ajax').hide(); $('#loading').show(); //run the ajax getPage(); //cancel the anchor tag behaviour return false; }); }); function pageload(hash) { //if hash value exists, run the ajax if (hash) getPage(); } function getPage() { //generate the parameter for the php script var data = 'page=' + document.location.hash.replace(/^.*#/, ''); $.ajax({ url: "loader.php", type: "GET", data: data, cache: false, success: function (html) { //hide the progress bar $('#loading').hide(); //add the content retrieved from ajax and put it in the #content div $('#ajax').html(html); //display the body with fadeIn transition $('#ajax').fadeIn('slow'); } }); } &lt;/script&gt; </code></pre> <p>So I have to use: page to run the ajax ... However, I am using in some places:</p> <p>Go to some <code>&lt;a href='#1'&gt; notices &lt;/ a&gt;</code> for example ... And when you click, instead of just driving to the id = '1 ', is doing the ajax code to run.</p> <p>How do I add an exception and not when you run the code number in the hash?</p>
 

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