Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Calling a another webpage in JSCRIPT

    Hi,
    I am not too familiar with JSCRIPT. But here is what I would like to accomplish and maybe someone can point me in the right direction.

    I would like to call another page from with in this function. Currently I have the response hard coded, but I would like to remove that and have a separate page that can be updated separately instead of editing the asp code. Thoughts?

    I have:
    Code:
    catch (wie) {
    	Response.Clear();
    	Response.Write("<HTML><BODY><CENTER><p>&nbsp;</p><b>Sorry Page Unavailable</b></CENTER></BODY></HTML>");
    	Response.End();
    	}

  • #2
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,068
    Thanks
    4
    Thanked 8 Times in 8 Posts
    in ASP classic using JScript, catch is used in error handling. as part of your error handling routine you can call other functions. what exactly are you trying to do?

  • #3
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, within the function I am trying to call a offline page.

    So instead of putting my offline message with in the response.write section. i would like to put it in a html page and have that html page called instead.

    I am new to this, so forgive me for not being more clear.

  • #4
    Senior Coder
    Join Date
    Dec 2002
    Location
    Arlington, Texas USA
    Posts
    1,068
    Thanks
    4
    Thanked 8 Times in 8 Posts
    Quote Originally Posted by arclight View Post
    Well, within the function I am trying to call a offline page.

    So instead of putting my offline message with in the response.write section. i would like to put it in a html page and have that html page called instead.

    ok so whenever an error is thrown you want to take the user to a different page? if that is the case just use a response.Redirect or server.transfer to move the user to the other page.

    I hope that is what you meant by your offline page.

    You do understand this will happen no matter what the error is correct?

    There is better built in custom error handling in IIS. this way you can use the catch statement to update a database or a text file giving you specifics of what the error is and still move the user to a different page.

  • #5
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for pointing me in the right direction. I was able to get it working now.

    My code looks something like this.

    Code:
    ....catch (wie) {
    	Response.Clear();
    	Response.Redirect ("/" + Application ("wiroot") + "/scripts/login/serverunavailable.asp");
    	Response.End();
    	}
    %>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •