#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    USA
    Posts
    12
    Rep Power
    0

    Question problems opening Scripts using Http Servlets


    I have problems opening a script under Servlets.

    Is this correct and where is my mistake?


    out.print("<script language=\"JavaScript\">");
    out.print("<!--\n function popURL(URL) {");
    out.print("day = new Date();");
    out.print("id = day.getTime();");
    out.print("eval(\"page\" + id + \" = window.open(URL, '\" + id + \"', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=250,height=100,left = 387,top = 334');\");");
    out.print("}");
    out.print("</script>");

    out.println("</table></center></body></html>");
    out.println("<title>" + title + "</title>");
    out.println("</head>");
    out.println("<body bgcolor=\"#DFE2FD\">");
    out.print("<form>");
    out.print("<input type=button value=\"Open the Popup Window\" onClick=\"javascriptopUp('http://www.yahoo.com')\"></form>");

    Thanks
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Windsor ON, Canada
    Posts
    462
    Rep Power
    14
    i think that little face sticking out it's tongue might complicated things...

    that output is sent to the client as part of the html page. view the source of the page that is generated and see if you get the desired output.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    USA
    Posts
    12
    Rep Power
    0

    problem opening scripts using HttpServlets


    Hi,

    The little face appears on this window because of unkown reasons. Does not appear in my code and that part of the code is (no space between ":" and "popUp")

    javascript: popUp('....

    any other idea why it would not work (gives me Error page in the lowest line of IE)

    Thanks
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Windsor ON, Canada
    Posts
    462
    Rep Power
    14
    the image thing was a joke. the face appears because : p (without the space) is the symbol for

    what is the error? it is not your servlet that is the problem. it's what you are writing to the page. it must be wrong.
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    USA
    Posts
    12
    Rep Power
    0

    Script works under Servlets


    It works fine now

    The problem was in theoreder it was embeded in the servlet and as well this line

    out.print("\n function popUp(URL) {");

    now it is correct.

    Thanks all for advising

IMN logo majestic logo threadwatch logo seochat tools logo