Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7712683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:41:36+00:00 2026-06-01T01:41:36+00:00

I have this function: <script type=’text/javascript’> $(‘#clicktogohome’).live(‘click’, function(){ history.pushState({}, ”, this.href); popstate(this.href); return false;

  • 0

I have this function:

<script type='text/javascript'>
$('#clicktogohome').live('click', function(){
  history.pushState({}, '', this.href);
  popstate(this.href);
  return false;
});
$('#listentosong').live('click', function(){
  history.pushState({}, '', this.href);
  popstate(this.href);
  return false;
});

popstate = function(url){
  url = '/ajaxlinks/'+window.location.pathname.substr(1);
  if (url == '/ajaxlinks/'){url =  '/ajaxlinks/index.php'}
  $('#ajaxloadcontent').load(url+"#ajaxloadcontent > *");
}

window.onpopstate = function(event){
  popstate(window.location.href);
  event.preventDefault();
}
</script>

This function is very important to my website and works perfectly, when I do not add this line:

if (url == '/ajaxlinks/'){url =  '/ajaxlinks/index.php'}

After adding this line, the new URL updates, and the back and froward button still work, however, it seems as if this line does not work and update the div on my page:

$('#ajaxloadcontent').load(url+"#ajaxloadcontent > *");

Is this common in jQuery and does anyone know how I can fix it. The function works without setting the variable “url,” but it must be done for my usage of the function. Does anyone know how to fix this? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T01:41:38+00:00Added an answer on June 1, 2026 at 1:41 am

    The problem is the lack of a space between the url variable and the string. It should, I think, be:

    $('#ajaxloadcontent').load(url+" #ajaxloadcontent > *");
    

    It’s an incorrect use of load() which expects a URL and a selector to be found in the page found at that URL.

    I’d also question why you’re using the > * selector; since using only #ajaxloadcontent will retrieve the element itself (including its descendant elements).

    Further to the comment left to this question:

    That still does not work for me. If you want to see the problem that I am having, go here pearlsquirrel.com/listen.php?u=101 and click on the PearlSquirrel logo. The URL updates and yet the content does not load. This still occurs with the code above.

    It’s important to note that the JavaScript console reports:

    GET http://www.pearlsquirrel.com/ajaxlinks/index.php 404 (Not Found)

    Not to mention reference errors:

    http://www.pearlsquirrel.com/:53Uncaught SyntaxError: Unexpected identifier
    http://www.pearlsquirrel.com/:365Uncaught SyntaxError: Unexpected end of input

    Reference:

    • load().
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this function working <script type=text/javascript> $(window).scroll(function() { if ($(window).scrollTop() == $(document).height() -
I have this simple function: <script type=text/javascript> //<![CDATA[ jQuery(function($){ function here(b){alert(b);} ; here(6); });
I have this script: <script type='text/javascript' src='js/jquery-1.4.4.mi.js'></script> <script type='text/javascript'> $('.filterMonth').change(function(){ alert('ijijiji'); $.ajax({ url: 'ajax/filterMandays.php',
I have this code: <script type=text/javascript> function showTotal(form, totalEl) { var el, els =
I have this code: <script type=text/javascript> function js() { var getJs = document.getElementById(jogo); if
i have this code: <script type=text/javascript> $(document).ready(function() { function doAjax(url) { $(#customForm).submit(function() { var
I have this menu : <html> <head> <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js></script> <script> $(function() { $(#menu).find(li).each(function()
I have this code: <script language=javascript> $(function() { $('#items,#button-search').hide(); $(#companies).click(function() { $(this).attr(value,); $('#address,#new-company-form').empty(); });
I have this script, running on a links list: $('li#linkcat-25 a').bind('click', function (e) {
THIS IS THE FULL SCRIPT http://goo.gl/HoCxk I have a problem with this function: $('.message').click(function(){

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.