Jump to content

Recommended Posts

Hello

 

I'm using anchor navigating on my website, the code for that looks like this (I include http://jqueryjs.googlecode.com/files/jquery-1.2.6.pack.js for this):

//On load page, init the timer which check if the there are anchor changes each 300 ms
$().ready(function(){
    setInterval("checkAnchor()", 300);
});
var currentAnchor = null;
//Function which chek if there are anchor changes, if there are, sends the ajax petition
function checkAnchor(){
    //Check if it has changes
    if(currentAnchor != document.location.hash){
        currentAnchor = document.location.hash;
        //if there is not anchor, the loads the default section
        if(!currentAnchor)
            query = "section=home";
        else
        {
            //Creates the  string callback. This converts the url URL/#main&id=2 in URL/?section=main&id=2
            var splits = currentAnchor.substring(1).split('&');
            //Get the section
            var section = splits[0];
            delete splits[0];
            //Create the params string
            var params = splits.join('&');
            
            var query = "section=" + section + params;
        }
        //Send the petition
$.get("page_callback.php",query, function(data){
            $("#content").html(data);
        });
    }
}

 

This works perfectly for me. Next whenever I include mootools 1.2, I get an error on running the script on:

 

"Object doesn't support this property or method."

on line 27 char 1, which is the following line

$.get("page_callback.php",query, function(data){

 

This error only happens when I include mootools scripts, I dont even have to use any mootools functions. My goal is making Form.send (from the mootools demo, where I got my mootools.js from) work with my anchor navigating script. I'm a beginner in js and any help is appreciated!! :)

 

Thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/217884-get-problem-with-mootools/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.