473,395 Members | 1,948 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

frame burst of images.google

there's this one i can't figure out.

I'm trying to kick out image.google.com's top frame when it goes to my
page.

If you go to
http://images.google.com/images?q=milk+tits
click on the page
http://xahlee.org/Periodic_dosage_di...caryatids.html
it should kick out the google's frame, but it isn't.

If i put a alert() in the script, it won't even popup. But i can't see
anywhere in google's html that has js or disables js.

however, it works in safari, but not in Mac Opera nor Mac Firefox nor
iCab. However, it all works if run from localhost with the frameset and
top frame from downloaded google.

any ideas?

Xah
xa*@xahlee.org
http://xahlee.org/

Feb 11 '06 #1
13 2720
Xah Lee wrote:
[...]
I'm trying to kick out image.google.com's top frame when it goes to my
page.

If you go to
http://images.google.com/images?q=milk+tits
click on the page
http://xahlee.org/Periodic_dosage_di...caryatids.html
it should kick out the google's frame, but it isn't.

If i put a alert() in the script, it won't even popup. But i can't see
anywhere in google's html that has js or disables js.
Your code is (pretty-printed):

function f()
{
if (window.top.location.href != window.self.location.href)
{
window.top.location.href = window.self.location.href;
}
}
window.setTimeout(f,1000*3);

Following <URL:http://jibbering.com/faq/#FAQ4_43> would have told you that
it causes

| Error: uncaught exception: Permission denied to get property Location.href

You are attempting to read `window.top.location.href'. Since the domain
of the frameset document's URL is "images.google.com" and the domain of the
URL of the frame document that contains the accessing code is "xahlee.org",
the Same Origin Policy forbids that. Do not compare locations but compare
object references instead.

Your window.setTimeout() call is unreliable; if window.setTimeout(), a
host object's method, is not supported, your script breaks; if it takes
more then 3 seconds to load the frameset completely, your script breaks;
if Function object references are not supported as first argument of
window.setTimeout(), your script fails or breaks.

Either or both may be the reason why no further script code (e.g.
`alert(...)') is executed then. Furthermore, `window.self' is
referring to the same object as `window' does, so it is inefficient
to use the former.

Try this:

function isMethodType(s)
{
return (s == "function" || s == "object");
}

if (typeof window != "undefined"
&& isMethodType(typeof window.setTimeout)
&& isMethodType(typeof window.clearTimeout))
{
var f = function()
{
if (typeof window.top != "undefined")
{
if (window.top)
{
if (window != window.top)
{
window.top.location = window.location;
}
else
{
if (typeof f.timeout != "undefined")
{
window.clearTimeout(f.timeout);
}
}
}
else
{
f.timeout = window.setTimeout("f()", 3000);
}
}
};

f();
}
however, it works in safari, but not in Mac Opera nor Mac Firefox nor
iCab. However, it all works if run from localhost with the frameset and
top frame from downloaded google.


The domain (localhost) is the same then.

BTW: Your markup is not Valid. <URL:http://validator.w3.org/>

BTW 2: This has nothing to do with stylesheets, so do not crosspost to
comp.infosystems.www.authoring.stylesheets.
F'up2 comp.lang.javascript

PointedEars
Feb 11 '06 #2
Xah Lee wrote:
«I'm trying to kick out image.google.com's top frame when it goes to
my
page.

If you go to
http://images.google.com/images?q=milk+tits
click on the page
http://xahlee.org/Periodic_dosage_di...caryatids.html
it should kick out the google's frame, but it isn't.
»

Thomas 'PointedEars' Lahn wrote:
«...»

nice suggestions, but none are useful in this context.

this is quite puzzling. Because after tried many things to diagnose the
problem, it might be that google has implemented some mechanism so as
to disable kicking out their frames. Because, when i tweaked the
script with some variation, clicking on the google image will result in
my page being completely blank below the google's panel frame, as if my
page tried to refresh and got botched. Or, some variation results both
google's top frame being blank as well as my page... but it works in
Safari and i couldn't locate any <script> in google's sources.

if i put a alert() in my page, it may or may not act depending on the
script variation i'm using.

Here's a variation that should just work:
<script type="text/javascript" defer>
if ( window.top != window.self) {window.top.location.href =
window.self.location.href;}
</script>

i've tried combinations of using “defer”, setTimeout,... itmay be
hard to test because it works locally. You'll need to find a search
string in google images so that it hits your page.

Xah
xa*@xahlee.org
http://xahlee.org/

Feb 11 '06 #3
Frameset Infinity!
http://xahlee.org/js/frame2/frameset.html

HTML Frame tutorial + Infinity!
http://xahlee.org/js/frame/0.html

Xah
xa*@xahlee.org
http://xahlee.org/

Feb 14 '06 #4
"Xah Lee" <xa*@xahlee.org> writes:
Frameset Infinity!
http://xahlee.org/js/frame2/frameset.html
Brilliant!

HTML Frame tutorial + Infinity!
http://xahlee.org/js/frame/0.html


Delightful!
Arnaud
Feb 14 '06 #5

"Xah Lee" <xa*@xahlee.org> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Frameset Infinity!
http://xahlee.org/js/frame2/frameset.html

HTML Frame tutorial + Infinity!
http://xahlee.org/js/frame/0.html

Why oh Why????
Feb 14 '06 #6
Just created Tab Menu tutorial.

Two tutorials for Tab Menu.

JavaScript implementation:
http://xahlee.org/js/tabs/a.html

Pure CSS implementation:
http://xahlee.org/js/tabs2/a.html

Xah
xa*@xahlee.org
http://xahlee.org/

Feb 19 '06 #7
In article <11*********************@g47g2000cwa.googlegroups. com>,
Xah Lee <xa*@xahlee.org> wrote:
Just created Tab Menu tutorial.

Two tutorials for Tab Menu.

JavaScript implementation:
http://xahlee.org/js/tabs/a.html
I avoid javascript whenever possible. Tabs are much simpler in CSS.
Pure CSS implementation:
http://xahlee.org/js/tabs2/a.html


This is an example of how NOT to do it, in my opinion.

You don't need to express tabs as a list. This is especially
important for tabs, which you may want to look like a horizontal
list of links for non-css browsers, rather than a vertical list of
links.

All you need is a border and color definition for the 'A' tag. Then
your tabs are as simple as a series of links:

<div id="nav">
<a name="#" id="current">current active tab</a>
<a href="page1.html">page 1 tab</a>
<a href="page2.html">page 2 tab</a>
</div>

See? No <ul...> list required.

The following CSS definitions for the HTML above will result in a nice
series of tabs, with the current tab having no bottom border to look
continuous with the page:

#nav { /* navigation bar which will have the tabs */
font-size: 1em;
text-decoration: none;
clear: both;
padding-top: 1px;
padding-left: 4px;
border-bottom: 1px solid #000000;
white-space: nowrap;
}
#nav a, #nav a:hover, #nav a#current { /* basic tab properties */
font-size: 1em;
text-decoration: none;
border-top: 1px solid black;
border-left: 1px solid black;
border-right: 1px solid black;
padding-left: .2em; padding-right: .2em;
padding-bottom: 0px;
}
#nav a { /* normal color of tab is CCCCCC */
border-bottom: 1px solid black;
color: #000000;
background-color: #CCCCCC;
}
#nav a:hover {
border-bottom: 1px solid black;
color: #000000;
background-color: #CCFFFF;
}
#nav a#current { /* color of "current" tab is white with green text */
border-bottom: 1px solid white;
color: #009933;
background-color: white;
}

-A
Feb 19 '06 #8
axlq wrote:
In article <11*********************@g47g2000cwa.googlegroups. com>,
Xah Lee <xa*@xahlee.org> wrote:
http://xahlee.org/js/tabs2/a.html
You don't need to express tabs as a list. This is especially
important for tabs, which you may want to look like a horizontal
list of links for non-css browsers, rather than a vertical list of
links.


When CSS isn't applied, a vertical list is a much better fallback than a
horizontal list, from both usability and accessibility standpoints.
<div id="nav">
<a name="#" id="current">current active tab</a>
<a href="page1.html">page 1 tab</a>
<a href="page2.html">page 2 tab</a>
</div>

See? No <ul...> list required.
And how do you think a screen reader will interpret this, as opposed to
list markup? How about Lynx? You've created a serious readability
problem, if nothing else.
The following CSS definitions for the HTML above will result in a nice
series of tabs,


....but only for graphical desktop browsers. You've completely ignored
any other browsing environment. :(

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Feb 19 '06 #9
In article <45************@individual.net>, kchayka <us****@c-net.us> wrote:
axlq wrote:
See? No <ul...> list required.


And how do you think a screen reader will interpret this, as opposed to
list markup? How about Lynx? You've created a serious readability
problem, if nothing else.


I always TEST things on Lynx. The example will look like a horizontal
list of links, exactly as I intend. It's a horizontal list of links on
ALL browsers. The only difference is that on CSS browsers, pretty
little borders appear around the links.
The following CSS definitions for the HTML above will result in a nice
series of tabs,


...but only for graphical desktop browsers. You've completely ignored
any other browsing environment. :(


Wrong. What I proposed was INTENDED for other environments.

-A
Feb 20 '06 #10
axlq wrote:
[again nothing that is on-topic in cljs]


The relevance this discussion once had to J(ava)Script/ECMAScript
programming, it does not have it anymore. Please stop crossposting
to comp.lang.javascript, unless you are going to introduce that
relevance again, and set Followup-To where it is appropriate.

Thanks in advance.
PointedEars
Feb 20 '06 #11
Thomas 'PointedEars' Lahn <Po*********@web.de> wrote:
axlq wrote:
[again nothing that is on-topic in cljs]


The relevance this discussion once had to J(ava)Script/ECMAScript
programming, it does not have it anymore. Please stop crossposting
to comp.lang.javascript


Please stop replying to posts with just header tweaking to keep your
precious cljs group clean. It doesn't work, as I explained to you before.

A crosspost without a follow up can not be "fixed" afterwards. Trying to
change things only add to the noise.

--
John Skilled Perl programmer for hire: http://castleamber.com/

Fox noGO:http://johnbokma.com/firefox/removin...earch-bar.html
Feb 20 '06 #12
Events: A Introduction to the Model of GUI programing
http://xahlee.org/js/events.html

Comments welcome. Thanks.

Xah
xa*@xahlee.org
http://xahlee.org/

Mar 4 '06 #13
Xah Lee wrote:
Events: A Introduction to the Model of GUI programing
http://xahlee.org/js/events.html

Comments welcome. Thanks.


The main benefit of writing explanatory material is that authors gain a
better understanding of what they are writing about. I've written
similar stuff but keep it to myself since releasing it to the public
would probably do more harm than good... :-)

Some comments on your article:
*Superficial*
You don't go into very much depth at all, leaving your readers to learn
just about everything from your MSDN references - as a result, they will
likely write IE-centric code and wonder why it doesn't work in other
browsers.
*Different event models*
You don't mention that there are two different event models, a pretty
fundamental concept for using events in browsers.
*References*
You have many reference to Microsoft resources, but none to the W3C.
Given that W3C is more important as a standards setting body, they
should be your primary reference.

MSDN should only be referenced where a suitable W3C reference doesn't
exist. Wherever an MSDN reference is used, an equivalent reference for
other platforms should be included - say Gecko and Opera at least (where
available).

There are some good articles about events, you should also reference
those, e.g. Quirksmode:

<URL: http://www.quirksmode.org/js/introevents.html >

and check your article for consistency with them.
*Attaching events*
You note two methods for attaching events, but there are others such as
addEventListener and attachEvent - but that would require you to explain
that there are two different event models.

*Event properties*
No mention is made of event properties, or even of event objects.
--
Rob
Mar 7 '06 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: xmp333 | last post by:
Hi, I know the noresize attribute will keep the user from resizing a frame, but is there a way to keep a frame from being resized by the browser (in response to things like different...
24
by: Charles Crume | last post by:
Hello; My "index.htm" page has 3 frames (content, navigation bar, and logo). I set the "SRC" of the "logo" frame to a blank gif image and then want to change it's contents after the other two...
11
by: opt_inf_env | last post by:
Hello everybody, I have created a page consisting of two frames. The second frame is made to display "external" sites (i.e. written not by me, for example www.google.com). But I found that some...
3
by: Evan | last post by:
I have a web page with 2 frames. The left frame is running menu.aspx and the right frame is running images.aspx. When a selection is made in menu.aspx I call a method in images.aspx and pass a...
6
by: wimvan | last post by:
Hi, I'm a nerd in javascript, but, after trying and retrying I'm addressing me to help. I have a page with three frames, a top-, a left- and a right-frame. a kind a title-frmae, a button-frame...
13
by: Xah Lee | last post by:
there's this one i can't figure out. I'm trying to kick out image.google.com's top frame when it goes to my page. If you go to http://images.google.com/images?q=milk+tits click on the page...
1
by: Xah Lee | last post by:
i have a problem i think only happens with OS X's Camino browser. (which is based on FireFox engine, but Fire Fox on OS X doesn't have this problem.) Basically, my website has javascript code...
2
by: PieOPah | last post by:
I have a webpage that uses frames (yes I know, frames - previously been flamed about that, but I do not know anything else to use since I am clueless!!! Been asked to cobble together a site since...
7
by: Leoa | last post by:
Hi All, I'm having a hard time figuring out the DOM syntax to get one frame that has thumnails of images to display at full size in another frame (onmouseover). I looked at a couple...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...

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.