Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 11-18-2009, 06:25 AM   #1
Active Warrior
 
coolboycsaba's Avatar
 
Join Date: May 2009
Posts: 69
Thanks: 10
Thanked 0 Times in 0 Posts
Social Networking View Member's YouTube Profile
Default Help needed with Javascript

I need a javascript code to write the id of the div where the code is placed. For example:

<div id="div1"><script type="text/javascript">.....</script></div>
The code will write: div1
And when i change the id of the div the code will write the new id
please help me

coolboycsaba is offline   Reply With Quote
Old 11-18-2009, 10:30 AM   #2
Coding Expert !! :D
War Room Member
 
pdjsolutions's Avatar
 
Join Date: May 2009
Location: India
Posts: 178
Thanks: 14
Thanked 15 Times in 12 Posts
Contact Info
Send a message via ICQ to pdjsolutions Send a message via AIM to pdjsolutions Send a message via Yahoo to pdjsolutions Send a message via Skype™ to pdjsolutions
Default Re: Help needed with Javascript

document.getElementById("div1").innerHtml = "";

I think that should do.

Am not sure.

Prateek
PDJSolutions

pdjsolutions is offline   Reply With Quote
Old 11-18-2009, 12:49 PM   #3
Active Warrior
 
coolboycsaba's Avatar
 
Join Date: May 2009
Posts: 69
Thanks: 10
Thanked 0 Times in 0 Posts
Social Networking View Member's YouTube Profile
Default Re: Help needed with Javascript

the problem is i don`t know the div id beacause i want to use this code for comments on a blog , each comment has a different div id

coolboycsaba is offline   Reply With Quote
Old 11-18-2009, 03:52 PM   #4
Paul Fitzpatrick
War Room Member
 
Join Date: Apr 2009
Posts: 100
Thanks: 38
Thanked 7 Times in 7 Posts
Default Re: Help needed with Javascript

Because Js is clientside only and your looking to create a unique reference for each div presumably from different client machines, I think that the only way todo this will be to grab your div number from a database or maybe server based text file using an ajax call, write your div, ++ the div number then write it back to the server once again using an ajax call. As ever nothing is simple .
da1fitz is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk

Tags
javascript, needed

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 03:34 PM.