Web Analytics Made Easy -
StatCounter Help with a java script - CodingForum

Announcement

Collapse
No announcement yet.

Help with a java script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help with a java script

    Hi Everybody I'm New Here

    I've been working on one of those rotor scripts and it works but I'm Having trouble with one part:

    <script language="JavaScript">
    <!--
    document.write ("<a href=?action=report&url='+parent.main.location.href+' target=_blank ><FONT face=Arial Black color=000000 >[Report Abuse]</FONT></a>")
    document.write ("spacers")
    document.write ("<a href='+parent.main.location.href+' target=_blank><FONT face=Arial Black color=000000 >[Open in a new window]</FONT></a>")
    // -->
    </script>

    This +parent.main.location.href+ is suppose to write the url of the site in the main frame but it doesn't could any body help me
    Last edited by oletom; Mar 9, 2004, 12:44 AM.

  • #2
    Welcome to CF!

    document.write ('<a href="?action=report&url='+parent.main.location.href+'" target="_blank" >...');

    It is recommended that you use double quotes in the html attribute values and do away with <font> tags. Use CSS to put style in your document.
    Last edited by glenngv; Mar 9, 2004, 12:48 AM.
    Glenn
    vBulletin Mods That Rock!

    Comment


    • #3
      Thanks for the help I've been pulling my hair out "What I have left of it anyway"


      <script language="JavaScript">
      <!--
      document.write ('<a href="?action=report&url='+parent.main.location.href+'" target="_blank" ><FONT face=Arial Black color=000000 >[Report Abuse]</FONT></a>')
      document.write ('spacers')
      document.write ('<a href="+parent.main.location.href+" target=_blank><FONT face=Arial Black color=000000 >[Open in a new window]</FONT></a>')
      // -->
      </script>

      I tryed this but when I did you could no longer see
      [Report Abuse] or [Open in a new window] ??

      Also without the font tags

      <script language="JavaScript">
      <!--
      document.write ('<a href="?action=report&url='+parent.main.location.href+'" target="_blank" >[Report Abuse]</a>')
      document.write ('spacers')
      document.write ('<a href="+parent.main.location.href+" target=_blank>[Open in a new window]</a>')

      and you still can't see [Report Abuse] or [Open in a new window]
      // -->
      </script>
      Last edited by oletom; Mar 9, 2004, 01:29 AM.

      Comment


      • #4
        Help yourself by enabling the javascript error notification (IE) or opening the Javascript console (NS).
        Glenn
        vBulletin Mods That Rock!

        Comment


        • #5
          Help yourself by enabling the javascript error notification
          Well thanks for trying to help

          Comment


          • #6
            Wouldn't it help you if you can see the error message?
            Not only now but in your future programming projects.
            Glenn
            vBulletin Mods That Rock!

            Comment

            Working...
            X