scifirocket
09-02-2010, 11:20 PM
so i have this "class" defined in a javascript file, "a.cross-link". This enables the ability for users to navigate the webpage in a slider format. it works fine if I directly place the required html code:
<a class="cross-link" href="#3" title="Go to Page 2">View Results</a>but if i have php print out that line for me, it doesn't work:
echo "<a class= \"cross-link\" href=\"#3\" title=\"Go to Page 3\">$name</a>";(Where $name is some variable)
Note: the php code is just your average sql stuff. here is an interesting observation i've made:
if i "hardcode" this this into the html: <a class="cross-link" href="#3" title="Go to Page 3">View Results</a>
and then i go to generate the sourcecode, this is what appears (this works): <A class=cross-link title="Go to Page 3" href="#3" jQuery1283131847233="30">View Results</A>
but if i have the html made by a php echo statement, it just stays the same - i dont get a jQuery1283131847233="30" generated in the sourcecode.
i'm sorry i'm having difficulty describing the problem. i'm new to jquery and ajax stuff. to me, it seems like the "cross-link" class i have defined in the javascript isn't being applied to correctly. i have no idea. can you invoke javascript from a php echo statement that is formatted to produce html code?
here is another thing i believe is true: when the page loads, the javascript loads. the users, through the use of ajax, submitts a sql querey and navigates, using a jquery slider, to another div (where i want the user to go after selecting a resulting link from the sql query). so the javascript is going to execute before the list of results is produced. do I need to rerun the javascript each time new php produced sql data is populated in a div? if so, how?
i dont know what more information you may need, so please ask. Thanks.
<a class="cross-link" href="#3" title="Go to Page 2">View Results</a>but if i have php print out that line for me, it doesn't work:
echo "<a class= \"cross-link\" href=\"#3\" title=\"Go to Page 3\">$name</a>";(Where $name is some variable)
Note: the php code is just your average sql stuff. here is an interesting observation i've made:
if i "hardcode" this this into the html: <a class="cross-link" href="#3" title="Go to Page 3">View Results</a>
and then i go to generate the sourcecode, this is what appears (this works): <A class=cross-link title="Go to Page 3" href="#3" jQuery1283131847233="30">View Results</A>
but if i have the html made by a php echo statement, it just stays the same - i dont get a jQuery1283131847233="30" generated in the sourcecode.
i'm sorry i'm having difficulty describing the problem. i'm new to jquery and ajax stuff. to me, it seems like the "cross-link" class i have defined in the javascript isn't being applied to correctly. i have no idea. can you invoke javascript from a php echo statement that is formatted to produce html code?
here is another thing i believe is true: when the page loads, the javascript loads. the users, through the use of ajax, submitts a sql querey and navigates, using a jquery slider, to another div (where i want the user to go after selecting a resulting link from the sql query). so the javascript is going to execute before the list of results is produced. do I need to rerun the javascript each time new php produced sql data is populated in a div? if so, how?
i dont know what more information you may need, so please ask. Thanks.