User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 361,942 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,682 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting

Insert a script with javascript?

Join Date: Oct 2005
Posts: 236
Reputation: Inny is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 4
Inny's Avatar
Inny Inny is offline Offline
Posting Whiz in Training

Insert a script with javascript?

  #1  
Mar 28th, 2008
Im trying to insert a script

<div class="js-kit-comments" permalink=""></div>
<script src="http://js-kit.com/comments.js"></script> 

into my boards profiles page

<tr>
             <td class="row3" valign='top'><b>Country</b></td>
             <td align='left' class='row1'>Australia</td>
           </tr>
  </table>

board http://inny.ipbfree.com/index.php?

to a particular spot beneath a td (profile field) called 'country'

I cant seem to get it to happen. can anyone help?

code I tried


<script>
//Godkillah, phantom-designs.net
tehsrc='http://js-kit.com/comments.js'
if(location.href.match(/showuser=[0-9]+/i)){script=document.createElement("script");script.src=tehsrc;a=document.getElementsByTagName("td");for(i=0;i<a.length;i++){if(a[i].document.getElementById('td').innerHTML='<div class="js-kit-comments" permalink=""></div>';  && a[i].getElementsByTagName("b")[0].innerHTML=='Country' && a[i].className=='row3'){a[i].appendChild(script);break;}}}
</script>
Last edited by Inny : Mar 28th, 2008 at 11:18 pm.
Attached Images
File Type: jpg untitled.JPG (92.1 KB, 2 views)
Always carry a flagon of whiskey in case of snakebite and furthermore always carry a small snake.
W. C. Fields
AddThis Social Bookmark Button
Reply With Quote  
All times are GMT -4. The time now is 11:34 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC