40 users online (1 members and 39 guests)  


  Results 1 to 2 of 2

Related

  1. Perl Interpretation Error    Forum: CGI Perl Forum
    Replies: 0
  2. Perl module error - ??    Forum: CGI Perl Forum
    Replies: 0
  3. Perl script error..    Forum: CGI Perl Forum
    Replies: 1
  4. perl sql concat error    Forum: CGI Perl Forum
    Replies: 1
  5. where is perl error log?    Forum: CGI Perl Forum
    Replies: 3
  1. #1
    itbug's Avatar
    New User

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    2

    error in perl with javascript

    HI all,
    I am getting error with java script , actually I want to set my page as home page, so each time when user will come and click it will open the same page, for that setting in cookie or session is done ...

    but for JS part i m getting error ......

    the code which I wrote is like that ...

    Code:
    if( $USER->is_logged_in() )
    {
    $greeting = "
    <NOBR CLASS=\'MYPAGEWELCOME\'>Welcome , $name!<\/NOBR>
    <SCRIPT LANGUAGE=\'JavaScript\'>
    
    var newContent = \'<A HREF=javascript:history.go(0); 
    
    newContent += onClick=this.style.behavior=\'url(\#default\#homepage)\';
    
    newContent += this.setHomePage(\'http://192.168.10.113/userchannel.pl\');>
    
    newContent += Click Here to Make My Web Page Your Homepage</a>\');
    
    document.write(newContent);
    </script>
    ";
    }
    and the $greeting will be returned in the same page where I want to put...

    this is the code actually I got from net to set the page as home page is something like that ....

    HTML Code:
    <a href="javascript:history.go(0);" onClick="this.style.behavior='url(#default#homepage)'; this.setHomePage('http://192.168.10.100');">
    Now how to implement this code in perl......

  2. #2
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: error in perl with javascript

    try this:
    Code:
    if( $USER->is_logged_in() )
    {
    $greeting = "
    <NOBR CLASS=\'MYPAGEWELCOME\'>Welcome , $name!<\/NOBR>
    <SCRIPT LANGUAGE=\'JavaScript\'>
    
    var newContent = "<a href=\"javascript:history.go(0);\" onClick="this.style.behavior='url(#default#homepage)'; this.setHomePage('http://192.168.10.100')\">Click Here to Make My Web Page Your Homepage</a>";
    
    document.write(newContent);
    </script>
    ";
    }



Tags for this Thread