Jump to content

JS not getting called. (Quotes fine)


zyrolasting

Recommended Posts

I do not think my echoed JavaScript function initializeNav() is getting called in the <body> tag.

 

function initializeChron($type)
{
$con = openConnect();
// Grab the number of entries available in the library and initialize chronological navigator.
$count = getLatestEntryId($type);
echo '<script type="text/javascript">initializeNav('.$count.','.$count.','.$type.');</script>';	
mysql_close($con);
}

 

I end up getting no output and FireBug breaks at the call in <body>, but I can not step into it. The watch panel shows an object I set up in initializeNav() is undefined, and also shows my stringisized version of the function call with the arguments I hoped to pass into it (initializeNav(2,2,news)). I did a couple of echoes in the other two functions and confirmed they are working just fine.

 

I have no idea what's wrong. What do I do?

Link to comment
https://forums.phpfreaks.com/topic/178522-js-not-getting-called-quotes-fine/
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.