472,143 Members | 1,833 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,143 software developers and data experts.

Disabling javascript

Hello,

I have a page in which an iframe calls an external website.
I'd like to disable javascript for the page called in the iframe.
Is it possible ? How ?

Thanks in advance,

--
stephan
Nov 5 '05 #1
14 1655
stephan wrote:
Hello,

I have a page in which an iframe calls an external website.
I'd like to disable javascript for the page called in the iframe.
Is it possible ? How ?

No, you can't, but why even try to disable it? If you don't want to use
Javascript, don't put any in the frame or page. Either way, leave my
browser alone. Its mine, not yours.
Nov 5 '05 #2
> No, you can't, but why even try to disable it? If you don't want to use
Javascript, don't put any in the frame or page. Either way, leave my
browser alone. Its mine, not yours.


well... thank you...
In fact, as I said, the called page belongs to another website.
So when the external page is loaded, on some websites, a parent.frame test
triggers an alert on my website :-(
I wanted to disable javascript in order not to bother my users.

--
stephan
Nov 5 '05 #3
stephan said the following on 11/5/2005 12:18 PM:
No, you can't, but why even try to disable it? If you don't want to use
Javascript, don't put any in the frame or page. Either way, leave my
browser alone. Its mine, not yours.

well... thank you...
In fact, as I said, the called page belongs to another website.
So when the external page is loaded, on some websites, a parent.frame test
triggers an alert on my website :-(
I wanted to disable javascript in order not to bother my users.


Stop putting other peoples pages in your frameset and you don't have
that problem anymore.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 5 '05 #4
>
Stop putting other peoples pages in your frameset and you don't have
that problem anymore.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices -

http://www.JavascriptToolbox.com/bestpractices/

Is it a joke ?
I ask you how to do it and you tell not to !
I must say I don't know much about javascript and maybe it's part of the
best practices... if so, I apologize.
Still, you don't you the app I'm coding and the point of my request... so I
understand.
Thanks anyway, I got the answer, it seems to be impossible.
Nov 6 '05 #5
stephan said the following on 11/6/2005 8:37 AM:
Stop putting other peoples pages in your frameset and you don't have
that problem anymore.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/

Is it a joke ?


Is what a joke?
I ask you how to do it and you tell not to !
This is Usenet, not a help desk. You asked how to solve a problem, I
gave you a solution. It wasn't the solution you wanted, but it was a
solution to your problem.
I must say I don't know much about javascript and maybe it's part of the
best practices... if so, I apologize.
It's not listed in there.
Still, you don't you the app I'm coding and the point of my request... so I
understand.
Thanks anyway, I got the answer, it seems to be impossible.


It doesn't "seem" to be impossible. If you are intent on stealing
content from another website, then have your sever retrieve the document
from the other website, strip its scripting, then insert it as your own
page.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 6 '05 #6
> Is what a joke?

The fact a simple help request becomes the trial of a supposed criminal !
I ask you how to do it and you tell not to !
This is Usenet, not a help desk. You asked how to solve a problem, I
gave you a solution. It wasn't the solution you wanted, but it was a
solution to your problem.


It was no solution at all, avoiding a problem is not solving it.
Anyway, thanks for your lessons.
Still, you don't you the app I'm coding and the point of my request... so I understand.
Thanks anyway, I got the answer, it seems to be impossible.


It doesn't "seem" to be impossible. If you are intent on stealing
content from another website, then have your sever retrieve the document
from the other website, strip its scripting, then insert it as your own
page.


I swear I was not trying to steal content from other websites.

Thank you for your answers.

--
stephan
Nov 7 '05 #7
stephan wrote:
No, you can't, but why even try to disable it? If you don't want to use
Javascript, don't put any in the frame or page. Either way, leave my
browser alone. Its mine, not yours.


well... thank you...
In fact, as I said, the called page belongs to another website.
So when the external page is loaded, on some websites, a parent.frame test
triggers an alert on my website :-(
I wanted to disable javascript in order not to bother my users.

Stephan, I appreciate your problem and I hope you appreciate the
solution... and it is a solution.

First, if you don't want Javascript then don't use it.

Second, if you don't want a third-party page to use Javascript then
arrange with the third party to remove it. If the third party will not
do so then your page should not include theirs... you *do* have their
permission to use it, I presume?

Third, in the admittedly highly unlikely event that you *do* have their
permission to use the page, that they will *not* remove the Javascript
and that they *do* permit you to remove it from your version of their
page then instead of using a frame you should set up a <div> layer
rather than a frame, load their content using XmlHttpRequest, remove the
<script> tags and content and display it in your layer.
Nov 7 '05 #8
The Magpie said the following on 11/7/2005 3:48 PM:
stephan wrote:
No, you can't, but why even try to disable it? If you don't want to use
Javascript, don't put any in the frame or page. Either way, leave my
browser alone. Its mine, not yours.

well... thank you...
In fact, as I said, the called page belongs to another website.
So when the external page is loaded, on some websites, a parent.frame
test
triggers an alert on my website :-(
I wanted to disable javascript in order not to bother my users.

Stephan, I appreciate your problem and I hope you appreciate the
solution... and it is a solution.

First, if you don't want Javascript then don't use it.

Second, if you don't want a third-party page to use Javascript then
arrange with the third party to remove it. If the third party will not
do so then your page should not include theirs... you *do* have their
permission to use it, I presume?

Third, in the admittedly highly unlikely event that you *do* have their
permission to use the page, that they will *not* remove the Javascript
and that they *do* permit you to remove it from your version of their
page then instead of using a frame you should set up a <div> layer
rather than a frame, load their content using XmlHttpRequest, remove the
<script> tags and content and display it in your layer.


Have you tried loading a document using XMLHTTPRequest from a different
domain when the page is loaded from a server? You get a security
warning. Script can't access a page outside it's own domain.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 7 '05 #9
stephan said the following on 11/7/2005 4:19 AM:
Is what a joke?

The fact a simple help request becomes the trial of a supposed criminal !


This is no trial, and you are the only that supposed yourself to be a
criminal. But it is a well known phenomenon on the web that sites try to
steal content from other sites by putting it in a frameset with a hidden
frame. If you do not fall into that category, then you have nothing to
worry about.
I ask you how to do it and you tell not to !
This is Usenet, not a help desk. You asked how to solve a problem, I
gave you a solution. It wasn't the solution you wanted, but it was a
solution to your problem.

It was no solution at all, avoiding a problem is not solving it.


The reason you got the solution you got is because there is no way, with
client side javascript, to do what you are wanting to do. It's a
security violation.
Anyway, thanks for your lessons.

Still, you don't you the app I'm coding and the point of my request...
so I understand.
Then explain what your app is.
Thanks anyway, I got the answer, it seems to be impossible.

It doesn't "seem" to be impossible. If you are intent on stealing
content from another website, then have your sever retrieve the document
from the other website, strip its scripting, then insert it as your own
page.

I swear I was not trying to steal content from other websites.


Fair enough. Set up a script on your server that will retrieve the
document, remove the script elements, and then display it with a URL
from your page. But without expressed permission of the outside site,
that does fall into the stealing content category.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 7 '05 #10
Randy Webb wrote:

Have you tried loading a document using XMLHTTPRequest from a different
domain when the page is loaded from a server? You get a security
warning. Script can't access a page outside it's own domain.


I did note, if you recall, that all that was assuming the OP had
permission and presumed that with that permission would go the security
measures needed to get the page.
Nov 8 '05 #11
Lee
The Magpie said:

Randy Webb wrote:

Have you tried loading a document using XMLHTTPRequest from a different
domain when the page is loaded from a server? You get a security
warning. Script can't access a page outside it's own domain.


I did note, if you recall, that all that was assuming the OP had
permission and presumed that with that permission would go the security
measures needed to get the page.


Those are two completely different issues. The author having permission
to use the page is not going to change the security settings on each
individual visitor's browser.

Nov 8 '05 #12
The Magpie said the following on 11/8/2005 8:57 AM:
Randy Webb wrote:

Have you tried loading a document using XMLHTTPRequest from a
different domain when the page is loaded from a server? You get a
security warning. Script can't access a page outside it's own domain.


I did note, if you recall, that all that was assuming the OP had
permission and presumed that with that permission would go the security
measures needed to get the page.


Even assuming that I give you permission to use a page of mine, unless
you load it from the server and pass it to the page, client-side
javascript has no way to read the actual file. See my other reply today
and it becomes easier to understand why you can't. Its a security issue.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 8 '05 #13
Well there's no Javascript answer that I can think of... However if you're also using a server side language like JSP or Perl CGI
you could access the page from there, put it in a buffer, stripe the Javascript, then send it out to the browser as part of the page
your displaying without an IFrame.

Just some thoughts...

Dennis

stephan wrote:
Hello,

I have a page in which an iframe calls an external website.
I'd like to disable javascript for the page called in the iframe.
Is it possible ? How ?

Thanks in advance,

--
stephan

Nov 9 '05 #14
Lee wrote:
The Magpie said:
Randy Webb wrote:
Have you tried loading a document using XMLHTTPRequest from a different
domain when the page is loaded from a server? You get a security
warning. Script can't access a page outside it's own domain.


I did note, if you recall, that all that was assuming the OP had
permission and presumed that with that permission would go the security
measures needed to get the page.


Those are two completely different issues. The author having permission
to use the page is not going to change the security settings on each
individual visitor's browser.


Fair point. I made assumptions I shouldn't have.
Nov 9 '05 #15

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by Ralph Freshour | last post: by
3 posts views Thread by Russell McDade | last post: by
22 posts views Thread by Papajo | last post: by
6 posts views Thread by ML.Steve | last post: by
2 posts views Thread by Jeelz | last post: by
3 posts views Thread by PB | last post: by
7 posts views Thread by John Meyer | last post: by
reply views Thread by Saiars | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.