It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Redirect problem

Redirect problem

Postby koolsamule on Fri Sep 25, 2009 12:43 pm

Hi guys,

I have this script to print a page, which it does fine.

However, after the script runs, the browser redirects to the folder root:

Code: Select all
<SCRIPT Language="Javascript">
//PRINT PAGE FUNCTION
function printit(){ 
if (window.print) {
    window.print() ; 
} else {
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(6, 2);//Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = ""; 
}
}
</script>


How can I stop this happening? I want remain on the current page!
koolsamule
 
Posts: 8
Joined: Thu Sep 03, 2009 11:32 am

Who is online

Users browsing this forum: No registered users and 6 guests