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 Link to comment https://forums.phpfreaks.com/topic/42902-need-help-for-increment-numbers/ 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> Link to comment https://forums.phpfreaks.com/topic/42902-need-help-for-increment-numbers/#findComment-208368 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 Link to comment https://forums.phpfreaks.com/topic/42902-need-help-for-increment-numbers/#findComment-208440 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 Link to comment https://forums.phpfreaks.com/topic/42902-need-help-for-increment-numbers/#findComment-208443 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 Link to comment https://forums.phpfreaks.com/topic/42902-need-help-for-increment-numbers/#findComment-208452 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. Link to comment https://forums.phpfreaks.com/topic/42902-need-help-for-increment-numbers/#findComment-208490 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 Link to comment https://forums.phpfreaks.com/topic/42902-need-help-for-increment-numbers/#findComment-208515 Share on other sites More sharing options...
ginocote Posted March 16, 2007 Author Share Posted March 16, 2007 Any help? Link to comment https://forums.phpfreaks.com/topic/42902-need-help-for-increment-numbers/#findComment-208748 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.