Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Page prevented for being displayed when using javascript

Reply
Thread Tools

Page prevented for being displayed when using javascript

 
 
schitroc@gmail.com
Guest
Posts: n/a
 
      04-30-2009
Hi all,

1) My web server is behind a firewall, and some users are using the
following setup to access it:
<input type="button" value="Continue" onClick="javascript:goToMyCompany
('')";/>
<script language="javascript">
function goToMyCompany()
{
location.href="http://myserver.com";
}
</script>

They are getting the 'Problems with this web page might prevent it
from being displayed properly' error messages.

2) This is javascript that I am using and this is the error that the
user is getting on his browser: 'Error:
somefile.serviceObj.lastservice' is null or not object.

<script type="text/javascript" src="/Resources/stdheaders.js"></
script><script type="text/javascript" src="/Resources/somefile.js"></
script>
<script type="text/javascript">
somefile.pageCount=somefile.pageCount||0;
somefile.pageCount++;
somefile.serviceObj={lastservice:"",nowservice:"", userid:""}

somefile.serviceObj.lastservice = lastservice;
</script>
The above code works properly when the user is behind the firewall or
the user is outside of the firewall and uses the straigth URL:
http://myserver.com instead of the setup file from point 1. Hint: this
error appeared after I installed a fix for IE Cross-frame scripting
fix.

Any help is welcomed.

Thanks,
Silvio
 
Reply With Quote
 
 
 
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      04-30-2009
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> 1) My web server is behind a firewall, and some users are using the
> following setup to access it:
> <input type="button" value="Continue" onClick="javascript:goToMyCompany
> ('')";/>


This can not be Valid markup. If it was HTML, you would need to lose the
`/'; if it was XHTML, which requires the `/' but is case-sensitive, you
would need to use `onclick' instead. Given little support for XHTML at this
point, you should only declare and use HTML 4.01 unless XHTML is absolutely
necessary.

See <http://validator.w3.org/>

And lose the `javascript:'. In fact, you don't need any scripting here:

<form action="http://myserver.com/">
<input type="submit" value="Continue">
</form>

> <script language="javascript">


<script type="text/javascript">

since almost 10 years now. See above.

> function goToMyCompany()
> {
> location.href="http://myserver.com";
> }
> </script>
>
> They are getting the 'Problems with this web page might prevent it
> from being displayed properly' error messages.


The code above is unrelated to your problem and to the error message. A
plain URL like this is by no means a way to get through a firewall. (Do you
even know what a firewall really is?)

> 2) This is javascript that I am using and this is the error that the
> user is getting on his browser: 'Error:
> somefile.serviceObj.lastservice' is null or not object.
>
> <script type="text/javascript" src="/Resources/stdheaders.js"></


Avoid capital letters in resource names. Especially, consider
case-sensitive server file systems.

> script><script type="text/javascript" src="/Resources/somefile.js"></
> script>
> <script type="text/javascript">
> somefile.pageCount=somefile.pageCount||0;
> somefile.pageCount++;


The following is equivalent and more efficient:

if (!somefile.pageCount)
{
someFile.pageCount = 1;
}
else
{
someFile.pageCount++;
}

> somefile.serviceObj={lastservice:"",nowservice:"", userid:""}
>
> somefile.serviceObj.lastservice = lastservice;


The following is equivalent and more efficient:

somefile.serviceObj = {
lastservice: lastservice,
nowservice: "",
userid: ""
};

> </script>
> The above code works properly when the user is behind the firewall or
> the user is outside of the firewall and uses the straigth URL:
> http://myserver.com instead of the setup file from point 1.


I seriously doubt that your firewall has anything to do with it.
Client-side redirection with (window.)location to somewhere works
everywhere (where (window.)location is supported).

> Hint: this error appeared after I installed a fix for IE Cross-frame
> scripting fix.


A fix for a fix? And which one anyway?

> Any help is welcomed.


Unfortunately, you forgot to post the relevant snippet of somefile.js where
supposedly `somefile' is initialized. It is that initialization which is
successful but appears to assign a reference to a host object that does not
allow augmentation of it with a `serviceObj' property, or assignment of an
Object object reference to its existing `serviceObj' property.

Please read and take heed of <http://jibbering.com/faq/#posting> pp.


PointedEars
 
Reply With Quote
 
 
 
 
schitroc@gmail.com
Guest
Posts: n/a
 
      04-30-2009
Thomas,

These are the clarifications you asked:

1) I used the sessvars object to store user_id between several web
pages.
It worked like a charm until one of my clients used this page to
point to my web site:
<input type="button" value="Continue" onClick="javascript:goToMyServer
('')";/>
<script language="javascript">
function goToMyServer(
{
location.HREF="http://myserver.com";
}
</script>
Now the user is getting errors that the sessvar.serviceObj.lastservice
is null or not an object.
2) This is how I defined my sessvar object:
<script type="text/javascript" <script type="text/javascript" src="/
Resources/sessvars.js">
</script><script type="text/javascript">
sessvars.pageCount=sessvars.pageCount||0;
sessvars.pageCount++;
sessvars.serviceObj={lastservice:"",nowservice:"", userid:""}
</script>

3) This is where the error (sessvar.serviceObj.lastservice
is null or not an object) is generated (inside the javascript
section):
sessvars.serviceObj.nowservice = nowservice;
sessvars.serviceObj.lastservice = lastservice;

4) sessvars.js content:see this link: http://www.thomasfrank.se/sessionvars..html#comment104

Thanks,
Silvio



On Apr 30, 4:08*pm, (E-Mail Removed) wrote:
> Hi all,
>
> 1) My web server is behind a firewall, and some users are using the
> following setup to access it:
> <input type="button" value="Continue" onClick="javascript:goToMyCompany
> ('')";/>
> <script language="javascript">
> function goToMyCompany()
> {
> * *location.href="http://myserver.com";}
>
> </script>
>
> They are getting the 'Problems with this web page might prevent it
> from being displayed properly' error messages.
>
> 2) This is javascript that I am using and this is the error that the
> user is getting on his browser: 'Error:
> somefile.serviceObj.lastservice' is null or not object.
>
> <script type="text/javascript" src="/Resources/stdheaders.js"></
> script><script type="text/javascript" src="/Resources/somefile.js"></
> script>
> <script type="text/javascript">
> somefile.pageCount=somefile.pageCount||0;
> somefile.pageCount++;
> somefile.serviceObj={lastservice:"",nowservice:"", userid:""}
>
> somefile.serviceObj.lastservice = lastservice;
> </script>
> The above code works properly when the user is behind the firewall or
> the user is outside of the firewall and uses the straigth URL:http://myserver.cominstead of the setup file from point 1. Hint: this
> error appeared after I installed a fix for IE Cross-frame scripting
> fix.
>
> Any help is welcomed.
>
> Thanks,
> Silvio


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
The server encountered an internal error () that prevented it faisal-m@hotmail.co.uk Java 0 04-18-2007 03:20 PM
The server encountered an internal error () that prevented it faisal-m@hotmail.co.uk Java 0 04-18-2007 03:19 PM
XSL Transform Prevented by a Declaration Al Hatch XML 3 06-04-2006 04:44 PM
Can abbreviated printStackTrace() output be easily prevented for chained exceptions? Mike H Java 1 02-27-2004 04:09 PM
PIX NIX : A simple static and access-list (below) seems to have prevented ANY access through the PIX to the web. J Bard Cisco 2 01-10-2004 06:44 PM



Advertisments