Jump to content


Javascript help


1 reply to this topic

#1 Hacker-X

    Young Padawan

  • Members
  • Pip
  • 174 posts

Posted 25 September 2005 - 03:14 PM

i'd like someone to explain all lines of this simple code, please go into as much detail as possible!

<script type='text/javascript'>
<!--
// add link on the portal side of the submenu
// code by ticlo, http://ifsz.net/
function addSubmenuLink(url, text, blank) {
var e
e = document.getElementById('submenu')
if (e && e.nodeName == 'TABLE') {
e.rows[0].cells[0].innerHTML += ' &middot; <a href="' + url + '"' + (blank ? ' target="_blank"' : '') + '>' + text + '</a>'
}}
addSubmenuLink('http://www.somedomain.com', 'Visit somedomain.com')
// -->
</script>

(the above code was written by Stefan of the Invision Free Skin Zone)

this portion of the code i'd like to be explained... and again go into as much detail as possible
function addSubmenuLink(url, text, blank) {
var e
e = document.getElementById('submenu')
if (e && e.nodeName == 'TABLE') {
e.rows[0].cells[0].innerHTML += ' &middot; <a href="' + url + '"' + (blank ? ' target="_blank"' : '') + '>' + text + '</a>'
}}
addSubmenuLink('http://www.somedomain.com', 'Visit somedomain.com')

Edited by Hacker-X, 25 September 2005 - 03:14 PM.


#2 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 25 September 2005 - 03:55 PM

Well, from what i can tell, you have no problems with the script. If you want an explaination of it, go ask stefan. We're not here to write tutorials on others code.

Now, if the script doesn't work, that'd be slightly different, and still stefan's problem.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users