Jump to content

$.get() problem with mootools


hawkagent

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.