URGENT>>> HTML and Javascript question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Albert

    URGENT>>> HTML and Javascript question

    Hello all

    I am using a datafeed that provides me with a Javascript that spits
    out a bunch of hyperlinks to other locations.

    Her is what it looks like:

    <script language="javas cript"
    src=http://datafeed.XXXXXX .com/YYY.asp?area=XX &stories=10&url =www.ABC.com>
    </script>

    <script language="javas cript">
    for (row= 0;row < Docs.length; row++)
    {
    document.writel n(" <li class=\"style1\ " target=\"_blank \">" +
    Docs[row] + " </li> <br>");
    }
    </script>



    This will spit out a bunch of hyperlinks with bullets

    * link1
    * link2
    * link3

    The problem is that these links DO NOT pop up a new window. Instead,
    they just open in the current window.

    Since I do not have access to hyperlink HTML code to insert a
    target=_blank tag, I am stuck and can not figure out what to do. I
    need each link to pop open in a new window.

    Given that I can insert HTML tags insire the document.writel n, is
    there anything that I can put there that would solve my problem.

    Please advise ASAP.

    Thank you in advance
    Albert
  • kaeli

    #2
    Re: URGENT&gt;&gt;& gt; HTML and Javascript question

    In article <45ec5a88.04050 61006.57234393@ posting.google. com>,
    albert@saabcons ulting.com enlightened us with...[color=blue]
    >
    > Given that I can insert HTML tags insire the document.writel n, is
    > there anything that I can put there that would solve my problem.[/color]

    Yes.
    See my little example.
    Apply as appropriate.
    Tested in IE6.

    <html>
    <head>
    <title> New Document </title>
    </head>

    <body>
    <base target="_blank" >
    New<br>
    <a href="http://www.google.com" >Google</a><br>
    <a href="http://www.yahoo.com"> Yahoo</a><br>
    <base target="_self">
    Self<br>
    <a href="http://www.google.com" >Google</a><br>
    <a href="http://www.yahoo.com"> Yahoo</a><br>

    </body>
    </html>

    --
    --
    ~kaeli~
    Murphy's Law #2030: If at first you don't succeed, destroy
    all evidence that you tried.



    Comment

    • Michael Hill

      #3
      Re: URGENT&gt;&gt;& gt; HTML and Javascript question

      > <script language="javas cript">[color=blue]
      > for (row= 0;row < Docs.length; row++)
      > {[/color]

      new_win =
      window.open('', 'new_win','resi zable=yes,scrol lbars=yes,width =800,height=625 ,left=200,top=1 0');
      new_win.documen t.open("text/html");
      new_win.documen t.writeln("<htm l><body><ul>") ;
      new_win.documen t.writeln("<li class=\"style1\ " target=\"_blank \">" +
      Docs[row] + " </li>");
      new_win.documen t.writeln("</ul></body></html>");
      new_win.documen t.close();
      [color=blue]
      > }
      > </script>[/color]

      Dont know why you would want this but try that.

      Mike

      Comment

      Working...