...

View Full Version : Calling a another webpage in JSCRIPT



arclight
07-20-2007, 09:10 PM
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:

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

miranda
07-21-2007, 06:05 AM
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?

arclight
07-23-2007, 09:27 PM
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.

miranda
07-23-2007, 11:37 PM
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.

arclight
07-30-2007, 11:54 PM
Thanks for pointing me in the right direction. I was able to get it working now.

My code looks something like this.



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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum