Google Answers Logo
View Question
 
Q: javascript question ( No Answer,   0 Comments )
Question  
Subject: javascript question
Category: Computers > Programming
Asked by: code_blazer-ga
List Price: $10.00
Posted: 08 Apr 2004 15:31 PDT
Expires: 08 May 2004 15:31 PDT
Question ID: 327414
here's the scenario.  i have an html page with a frameset with 2
frames.  the first frame i have control of and the second frame comes
from another source.  there is a javascript function in that second
frame that is doing something undesirable.  so i want to do one of the
following two hacks: code to either (1) disable javascript only in the
second frame or (2) have html that i do control modify the javascript
function in the second frame presumably on the onload event so that i
can remove the offending code before it is executed.

Request for Question Clarification by googleexpert-ga on 08 Apr 2004 20:53 PDT
Hi code_blazer,
I would like to test my HTML page ( Posted Below ) with some "Offensive Code"
Can you give me an example URL that has some "Offensive Code"?
Thanks.
-googleexpert

<html>

<script language="JavaScript">
function pop()
{
	w0 = "";
	alert("I'm First!");
}
function pop()
{
	alert("I'm Second!");
}
</script>
<body onload="pop()">
hi
</body>
</html>

Clarification of Question by code_blazer-ga on 12 Apr 2004 13:38 PDT
it really doesn't matter what is inside the offending javascript
function but here's an example url that you asked for:

JavaScript Definitive Guide
http://www.amazon.com/exec/obidos/tg/detail/-/1565923928

view source to find the offending function xs_writeResults() (since it
tries to access the parent document which is not an amazon document):

function xs_writeResults()
{
if (xs_bv > 0) {
var xs_showMessage = "Thanks for your answer.";
var xs_html = "";
parent.document.getElementById('quizFrame').innerHTML = xs_html;
} // xs_bv
}

Request for Question Clarification by googleexpert-ga on 17 Apr 2004 05:41 PDT
I viewed the source code of:
http://www.amazon.com/exec/obidos/tg/detail/-/1565923928
on Two Browsers and could not find the function xs_writeresults().

anyway, since Amazon's page is interfering with the Parent Frame's page,
why can't you rename the function on the Parent Frame's page?

Clarification of Question by code_blazer-ga on 18 Apr 2004 11:36 PDT
> could not find the function xs_writeresults().

that's interesting.  for sanity checking, the 'r' is capitalized in
the function name in the off chance you are doing a case sensitive
search.  perhaps this part of the html returned is personalized.

> why can't you rename the function on the Parent Frame's page?

as far as i know, javascript functions defined in the parent frame are
not available to the child page.
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy