Jump to content

I need a new set of eyes


radar

Recommended Posts

Alright working on a site, getting my navigation working....  only thing is it doesn't work...

 

function changeNav(url) {

	var myRand = parseInt(Math.random()*99999999);
	var srcs = url+'&ints='+myRand;
	$('TransMsgDisplay').innerHTML = '<p><img src="templates/site/images/indicator.gif" align="center"></br>Loading Page, Please Wait.</p>';
var myAjax = new Ajax.Request(
srcs,
{
	method: 'get',
	onComplete: processNav
});
}

function processNav(originalRequest) {
var responseTextTrim=trim(originalRequest.responseText);
$('TransMsgDisplay').innerHTML=responseTextTrim;
}

 

that is my ajax-cs.js file.

 

then my php:

 

	case about: ########### BEGINNING OF ABOUT PAGE ############

		$sql = "SELECT aboutTxt FROM about";
		$data = mysql_result(mysql_query($sql), 0);
		$ybd->assign('data', $data);
		$page = 'flat_text.tpl';
	break; ################ END OF ABOUT PAGE ##################

if ($page != "") {
	$content = $ybd->fetch($ybd->$template_dir.'site/'.$page);
	if ($_int == '') {
		$ybd->assign('content', $content);
	} else {
		echo $content;
		return $content;
	}
}

 

then my html to call the link...

 

<a href="index.php?pg=about" class="nav_links" onmouseover="bgchange('nav4');" onmouseout="bghide('nav4');" onclick="changeNav('index.php?pg=about'); return false;">About Us</a>

 

the first part of the ajax works (in that it changes to my indicator.gif image.  but it just gets stuck there..  dont see any errors myself..  when i throw an alert into the processNav i just get an alert of: [object Object] which ive never gotten before.

Link to comment
Share on other sites

I got it figured out I guesss...  Still don't know why my trim wasnt working...

 

but basically my var responseTextTrim = trim(originalRequest.responseText); was failing, causing the responseTextTrim to be esentially nothing (so bad that not even an alert comes up for it)..  so i change the next line to $('TransMsgDisplay').innerHTML = originalRequest.responseText; and it works correctly.

 

so guess that's what i'm doing.

Link to comment
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.