ginocote Posted March 15, 2007 Share Posted March 15, 2007 Hi, i use a java scrip to expand content from a rss feed. It doesn't work because when all feed are showing, all javascrit have the same ID and each ID shoud be unique, can i create with php or javascritp a new ID for each java script created in this php loop with my result? Like increment by one for each result? I can add php into result because it's not inside javascript. like maintab1 maintab2 maintab3 But each element are not in the same php bloc code. Cheer Thank's Quote Link to comment Share on other sites More sharing options...
per1os Posted March 15, 2007 Share Posted March 15, 2007 What? This might help: <script type="text/javascript"> <?php $topNum = 3; for ($i=0; $i < $topNum;$i++) { print "var maintab" . $i . " = 'Some Value'"; } ?> <!-- js processing here --> </script> Quote Link to comment Share on other sites More sharing options...
ginocote Posted March 15, 2007 Author Share Posted March 15, 2007 Hi, how can i integrate your script in that? <div class="chunk" style="padding:0 5px;"> <ul id="maintab" class="shadetabs"> <li class="selected"><a href="#" rel="tcontent1">Description</a></li> <li><a href="#" rel="tcontent2">Listen</a></li> <li><a href="#" rel="tcontent3">Tab 3</a></li> <li><a href="#" rel="tcontent4">Tab 4</a></li> <li><a href="http://www.dynamicdrive.com">Dynamic Drive</a></li> </ul> So, the next one will be "maintab2" ect Thank's Quote Link to comment Share on other sites More sharing options...
aebstract Posted March 15, 2007 Share Posted March 15, 2007 You need to put code in code tags [ code ] and [ /code ] without spaces Quote Link to comment Share on other sites More sharing options...
ginocote Posted March 15, 2007 Author Share Posted March 15, 2007 You need to put code in code tags [ code ] and [ /code ] without spaces I don't see anywhere how i can edit my last message. Cheer Quote Link to comment Share on other sites More sharing options...
per1os Posted March 15, 2007 Share Posted March 15, 2007 You can't after 5 minutes, just create a new message with the code. Quote Link to comment Share on other sites More sharing options...
ginocote Posted March 16, 2007 Author Share Posted March 16, 2007 Hi, how can i integrate your script in that? <div class="chunk" style="padding:0 5px;"> <ul id="maintab" class="shadetabs"> <li class="selected"><a href="#" rel="tcontent1">Description[/url]</li> <li><a href="#" rel="tcontent2">Listen[/url]</li> <li><a href="#" rel="tcontent3">Tab 3[/url]</li> <li><a href="#" rel="tcontent4">Tab 4[/url]</li> <li>Dynamic Drive</li> </ul> So, the next one will be "maintab2" ect Thank's Quote Link to comment Share on other sites More sharing options...
ginocote Posted March 16, 2007 Author Share Posted March 16, 2007 Any help? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.