I’ve been using drupal for a bit now I thought that I would add some ajax code 
to my pages

The idea is that jquery is used to generate a list of content(nodes) from 
category link at the side, that in turn the user selects to add the interest 
content in the main page.

Everything appeared to be  working fine until on certain pages(ie pages that 
appear similar to www.mysite.com/node/190) the process would break and it 
appears that the full links are being load breaking the layout of the page its 
looks like the stopPropagation and preventDefault functions are not working.


 I get this error message can some one point my in some direction of what is 
taking place to generate the message 

Is it just a case that there is no input being passed - the message comes up 
using opera(js console) but nothing is displayed in firefox 

Unknown thread 
Error: 
name: TypeError 
message: Statement on line 1: Could not convert undefined or null to object 
Backtrace: 
  Line 1 of eval script 
    if (data.constructor == Function) 
    if (data) 
    jQuery.ajax("GET", url, null, function (r,status) 
{ 
  if (callback) 
    callback(jQuery.httpData(r, type), status); 
} 
, ifModified); 
  Line 1 of eval script 
    jQuery.get(url, data, callback, "script"); 
  Line 1 of eval script 
    if (this.src) 
    else 
      Line 1 of eval script 
    if (obj.length == undefined) 
    else 
    return obj; 
  Line 1 of eval script 
    return jQuery.each(this, fn, args); 
  Line 1 of eval script 
    if (status == "success" || ! ifModified && status == "notmodified") 
    else 
      Line 1 of eval script 
    if (xml && (xml.readyState == 4 || istimeout == "timeout")) 
      At unknown location 
    [statement source code not available]


My code is a little fragmented but 
This is the general idea (The problem could be that I call a load inside the 
callback of the first call ie somehow the $("#content").load(nodevar,{
});
 is left open)




$(document).ready(function(){ // Gets everything set up on page load
 
 
$("#block-block-1").find("a").click(function(e){
 
 
e.preventDefault();
e.stopPropagation();
 
 
 
var nodevarlist = 'www.mysite.com/loadlistdata’;
 
 
// Content in the SideBar has been selected now it time for the AJAX part
$("div.ajaxlist").load(nodevarlist,{
 
// Callback function runs once load complete for all the links generate sets up 
AJAX on the new links
// },function(){

// loaded stuff can be clicked,
// as stuff loaded this way has no event handlers attached
$("div.ajaxlist").find("a").click(function(g){
$("#content").fadeIn('slow').load('throbberCircle.html');
 
g.stopPropagation();
g.preventDefault();
 
 
 
var nodevar = '<?'www.mysite.com/nodedata’
$("#content").load(nodevar,{
});

return false; // so the link doesn't actually load a new page
});
return false; 
});
});

Any one got ideas


_____________________________________________________________
Sign up for Private, FREE email from Mail.ie at http://www.mail.ie
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to