473,386 Members | 1,720 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,386 software developers and data experts.

Getting source from adjacent frame


Is it possible for one frame to get the source code of an adjacent
frame of the same window?
Aug 10 '05 #1
3 1625
Mike wrote:
Is it possible for one frame to get the source code of an adjacent
frame of the same window?


script:
<script type="text/javascript"><!--
function vs(){
var doc=parent.FRAMENAME.location;
window.open('view-source:'+doc+','SourceView');
}
//--></script>

html:
<a href="#" onclick="vs();return false;">View Source</a>
/might/ work
--
Hope This Helped and MTFBWY...
Kieren aka JediFans - <URL:http://jedifans.com/>
The Force Is With Me, SuSE Linux Professional 9.3, Mozilla Firefox
1.0.6, Mozilla Thunderbird 1.5 Alpha 2 and Revenge Of The Sith!
Aug 10 '05 #2

What Jedi wrote should work, so long both frames are in the same domain,
crossdomain frames have no access to eachother.
Danny

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Aug 10 '05 #3
Carved in mystic runes upon the very living rock, the last words of
Danny of comp.lang.javascript make plain:
crossdomain frames have no access to eachother.


That's good to know; it would be better if the JS Console gave an
understandable error message. I've been banging my head on the desk,
trying to get my script to work. I want to have frame 1 put frame 2's
location into the top location; in effect, closing itself.
top.frames.length gave me 2, as expected, and top.frames[0].location gave
the expected result, but top.frames[1].location gives me this message in
the Console:

Error: uncaught exception: [Exception... "Could not convert JavaScript
argument arg 0 [nsIDOMWindowInternal.alert]" nsresult: "0x80570009
(NS_ERROR_XPC_BAD_CONVERT_JS)" location: "JS frame ::
http://www.holotech.loc/linkman/dev/linkrate.php :: <TOP_LEVEL> :: line
5" data: no]

Um...yeah....

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
Aug 17 '05 #4

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

Similar topics

7
by: Jane Austine | last post by:
As you add more items, say text lines, in Text widget, it gets too slow and almost impractical to use on. Take idle for example. If the text gets bigger(e.g. print...
3
by: John Draper | last post by:
I am having a lot of problems trying to get a Python CGI to run. I have included 3 parts... 1) A simple stripped down python module. 2) An output of what I get when I do: python index.py...
3
by: NullBock | last post by:
Hey, so I'm trying to put two iframes on a page adjacent to each other. here's my code : <html> <head><style type="text/css"> body { margin: 0; }
11
by: Brett | last post by:
In Yahoo mail, I click the Inbox link and see my messages. If I view source, I don't have HTML which contains the URL of each message. The source HTML contains javascripting and framesets. This...
1
by: Mike | last post by:
Is it possible for one frame to capture the source code of an adjoining frame in the same window?
8
by: R. Bernstein | last post by:
In doing the extension to the python debugger which I have here: http://sourceforge.net/project/showfiles.php?group_id=61395&package_id=175827 I came across one little thing that it would be nice...
4
by: R.Manikandan | last post by:
Hi In my code, one string variable is subjected to contain more amount of characters. If it cross certain limit, the string content in the varabile is automatically getting truncated and i am...
5
by: BeanWorks | last post by:
Hi, I've been looking through books and posts, but so far I can't find anything that really addresses this problem. I have a frameset page with three frames, one on top with static content, and...
12
by: mistral | last post by:
Can anybody tell me how to get source code of page in iframe? (popup window is clickable image). When I right click on this popup border to view source, i see just as follows <html> <head>...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.