Using DOM To Get At The Contents Of A Modified Frame

Nov 19, 2003

The application that I am trying to develop is a web-crawler written in JavaScript. The top module called JSBrowse.html defines two frames: an upper one called toppart, and a lower one called bottompart. Toppart.html in turn defines two frames: one called leftpart and one called rightpart. (I would have atached all 4 modules, but I don't know how to attach more than one module, so I chose rightpart.html.)

Leftpart shows the current www page that you have crawled to.

Rightpart contains a button that takes you to the next page in what will eventually be a pushdown list.

Bottompart scans each page for the presence of keyword, and also shows the dom structure of the document.

In rightpart I use this statement to update the URL of leftpart: parent.frames('leftpart').window.document.URL=document.form1.text1.value;

THE PROBLEM IS: The DOM tree that is displayed is the tree of my original html page (i.e., leftpart). What I want is the DOM tree of the current content.

I own 5 books on JavaScript including "HTML Black Book", "JavaScript: The Complete Reference", and 3 others, and I have not found the answer to my question.

I could sure use a clue, or ideas to solve this problem.

View 3 Replies


ADVERTISEMENT

Print Contents Of One Frame From Another Frame?

Sep 8, 2010

I have a frameset with two frames; topFrame and mainFrame. I have code in topFrame and wish to print the contents of mainFrame. The code that I have used has worked for many years and still works on my localhost Apache Server. However, it has now "stopped" working. When I press the button in topFrame it prints the contents of topFrame The code that I am using is

Code:
window.parent.mainFrame.focus()
window.print

I have tried to replace the first line with..

[Code]...

View 1 Replies View Related

Set The Frame Contents When Opened A Frameset In New Window?

Oct 6, 2009

How do I set the contents(src) of a frame in a frameset when opened in new window?(frameset has a frame called APtop)I have following code

newWind = window.open("http://server/db.nsf/ActionPlan?OpenFrameSet","_blank");
newWind.frames['APtop'].location.replace("http://server/db.nsf/Administration?OpenPage");

It does not work... I even tried

newWind.document.getElementById('APtop').src = "http://server/db.nsf/admin?OpenPage";

How do i do this?

View 4 Replies View Related

JQuery :: Use A Parent-frame - Objected To Make Child-frame AJAX?

Aug 26, 2011

I have a domain: example.com; which is the parent.And a subdomain: api.example.com; which page 'receiver.html' is being loaded in an iframe, child of parent. Both pages set document.domain = example.com.

I'm trying to adapt this code:[url] but Idon't want to load jQuery from the <iframe> again but I need to have the method $.ajax() working from the <iframe> otherwise it would be a cross-domain request and the browser would abort it. I tried ingenuously to set via $('iframe')[0].contentWindow.$.ajax = $.ajax() and I just got a shortcut to the parent page jQuery method. I also tried to "clone" it using $.expand (true...) but the method doesn't work for me; probably because of the complexity of the objected I'm trying to clone. So is there a way for me to use jQuery to have only a $.ajax() method in the <iframe> ? I've thought even about creating a XHR in the child-iframe and then use that in the $.ajaxSetup ({xhr: THATNEWXHR}) but I couldn't do it. I mean, I want to use the XHR factory from jQuery (which has fallbacks for IE, etc) but it has to be created from the iframe-child.

Maybe there is other way to make the AJAX call come from the child-iframe.

If you're wondering "why don't you load jQuery from <script> in the child-iframe", there is a reason... As I'm using jQuery plugins + my own custom javascripts + other independent scripts I created a compiler which minifies each file and bundle them in one. The advantage of this is the reduction of HTTP requests. So "why don't you load that bundle inside the child-iframe?", because it's ugly and Twitter doesn't... Yeah, I like to take Twitter as a reference and I think if they were able to make it so can I;

I got to work in most browsers except IE and Operaby doing it with pure javascript.

I'm "attaching" the code for you guys to test. If you open it with Chrome, Safari or Firefox you will receive 2 alerts one with the return of $.get() and another with the return of a request made via XMLHttpsRequest object. Otherwise (if you open it with IE or Opera) you'll get 'undefined' in the first alert but the real return in the second.

This is the example.com/index.htm:

View 4 Replies View Related

Dump Of Modified DOM ?

Dec 27, 2006

Is there a script I can get or a means where after a javascript program has altered the html in the DOM it can be printed out to some text window ? This might help me analyze complex programs to figure out what they did to the html.

View 1 Replies View Related

Modified To Allow For 2 Instances?

Oct 7, 2010

I am using this photo shuffler code, located here: [URL] How can that be modified to allow for 2 instances? Basically, it would have 2 sets of arrays. I want to have 2 slide shows on the same page. I've tried modifying it myself for a few hours, and no luck.

View 4 Replies View Related

Go Back History Button On Top Frame That Affects Main Frame?

Oct 15, 2001

Im trying to make a back button that reloads the previous page the user was at.
The back button will be on a small top frame and the page that needs to be controlled will be in the main frame.

The top frame is just a navigation system, and all pages will be loaded in the main frame.
Im trying to use this Code:

<FORM>
<INPUT TYPE="button"
NAME="back"
VALUE="BACK"
onClick="history.go(-1)">
</FORM>

Does anyone know how I could accoplish the desired result using this code, or any other code? And what about a foreward button?

View 2 Replies View Related

Show When A Page Was Last Modified?

Jan 23, 2001

What's the javascript to show when a page was last modified?

View 2 Replies View Related

Function Modified To Fullscreen

Jun 8, 2007

I am using this code I got from a friend of mine but I wish to chnage the dimensions of the page to Fullscreen.

Code:

<script>
var win = null;
function popup(mypage)
{
w=800
h=800
mypage="images/screenshots/"+mypage+".swf"
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;

settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable=yes'
win = window.open(mypage,"popup",settings)
}
</script>

View 4 Replies View Related

Click On 1 Of The 3 Frame Options The Frame Changes Showing A Preview?

Jul 20, 2010

I want to have a main image in place and when you click on 1 of the 3 frame options the frame changes showing a preview. Also I would like the add to cart button change its code to add the correct item as well.

View 2 Replies View Related

How Do I Format The Last-Modified Date With Javascript?

May 7, 2007

Apparently, ` new Date() ` reads it correctly, though problems
can occur if the browser returns only two digits for the year.
In particular, time zone, field order and separators may vary.
It is also reliant on the server's clock having been correctly
set at the time of upload. See the URL below.

View 1 Replies View Related

Analyze The Contents Of A Textbox And Replace The Contents With The Appropriate Date?

Jul 15, 2009

I'm looking for javascript to analyze the contents of a textbox and replace the contents with the appropriate date. To make that a little clearer, if the user types 'tomorrow' then when they tab/move onto the next text box the 'tomorrow' text should be replaced with the date for tomorrow in the format dd/mm/yyyy, if the user enters '1 week' then the text should be replaced with the date in one week in the format dd/mm/yyyy etc.

View 1 Replies View Related

PASSING Data From One Frame To Another Frame In A Frameset

Aug 30, 2010

i need to pass the data in the textfields from the left frame to the textfields in the right frame of my frameset. (ex: dslnum of frame1 will be pass to txtDSLTN of frame2)[URL]

View 19 Replies View Related

Change Frame Url With Clicking Link In Another Frame

May 22, 2011

I have two frames (frameset, let's call it frame1 and frame2). Frame1 has links..., and frame2. When some link in frame1 is clicked, it must be changed content of the frame2. Here's example: click. How to do that? (I don't see any javascript code)

View 2 Replies View Related

Breaking Out Of Parent Frame If Child Frame Changes URL

Jul 19, 2006

I have a parent document that has a frameset with two frames in it. The first frame is a "header" that runs across the top of the site, and never changes. The second frame contains the "content" of the site. Essentially, I am trying to figure out how to prevent the header appearing above external sites when the user clicks an external link in the "content" frame.

Every time the content frame changes to a new URL, I would like the check that URL and determine if the content frame is changing to an external URL (i.e. different domain in URL) or to an internal link (same domain in URL). If the content is changing to an external link, I want to break out of the frame and just load that external link in the top most document.

I would like all of my javascript to be in the parent document, not spread throughout the individual pages of the site. I was trying to approach this by setting the onunload event handler of the content frame, but I am left with a couple of specific questions:
1. In handling an unload event, can you determine the next URL that the document is loading? Code:

View 6 Replies View Related

Open The Frame Inside The Main Frame

Jan 10, 2011

I have a little problem, I structure my site with a main page index.html with a frame in the central whit name CENTRALE, so every other page I will open within this frame. Now I need to have a direct link to these internal pages, give an example I wish it were possible to go to the page clothing giving a direct link to that section of the site type www.indirizzo.com / clothing.html because the state of things if I take the 'direct address to that page I open only the part inside of the frame, but I wish I would open inside the "main frame, there is a solution in javascrip to overcome this problem?

View 4 Replies View Related

Submit Form Does Not Include Modified Fields

Jun 29, 2010

I have created a web page loaded from MySQL and PHP.It contains a text field, two list boxes and a hidden field for items moved between the list boxes.When I submit the form it send the text field and the last list box item moved but NOT the hidden text field

View 7 Replies View Related

Reload Page If File Was Modified Using Javascript

Nov 16, 2004

Basically, I want a page to load, and then every 5 seconds be able to check a file to see if it has been modified since the last time the page loaded. If it has refresh, if not then wait 5 more seconds. Is this possible using javascript?

View 3 Replies View Related

Simple Cookie To Load Modified Page

Sep 22, 2005

I'm searching for a pre-made cookie script or a tutorial on making a simple session cookie. Just a cookie to make sure users are getting most current copies of HTML pages on my site.

Up till now I've just had messages on each page instructing them to refresh to make sure the have the latest version.

View 5 Replies View Related

Displaying An Image Dependent On When Another HTML Document Is Modified

Oct 9, 2005

I have a site that is built with a frameset. What I would like to do is whenever I update a particular frame that contains the main content (ie. a news.html page), have it change a graphic in the navigation bar (ie. a separate .html document) to a glowing animated gif for 7 days. Since the news page doesn't load as the first page within the frameset, it would show that there was something new posted there.

I have a few JavaScript books around, and I -think- I know roughly what needs to be done, but I'm having trouble conjugating scripts.

I think it could be done by checking the date.lastModified against the current date, and if the abs difference was less than 7 days it would display news-anim.gif, else it would display news.gif - however I am not sure how to get the left navframe.html to read the date modified of news.html

Can anyone suggest any solutions (or know of any scripts out there?) or is this more of an issue that should be dealt with using cookies/something else?

View 13 Replies View Related

JQuery :: Modified Superfish Vertical Menus So The Flyout Is To The LEFT?

Oct 26, 2009

Has anyone modified Superfish vertical menus so the flyout is to the LEFT? How?

View 1 Replies View Related

PHP Interferes With LastModified Function - Shows The Date A Page Was Last Modified

Oct 6, 2009

I have found a useful script at [URL] which shows the date a page was last modified. I have put it at [URL] where it works perfectly. But the same script with a PHP file extension as here [URL] only shows the current time. There is no PHP in the page, but somehow the PHP processor seems to be upsetting it.

View 1 Replies View Related

Javascript Function To Save The Modified Page Into Local Hard Disk...

Nov 13, 2002

I use NETSCAPE established a catalog page in XML, which uses Javascript-DOM to add, remove and sort the products by their prices. But which Javascript function should I use in order to save the modified page into local hard disk? to sort products as well.

View 1 Replies View Related

Send Variables From Frame To Frame?

May 13, 2009

I use dreamweaver mx html editor to make web sites. I think I know enough Html to get by. My new site uses a frame set so the head and controller don't change reload or move. This works nice, now all I have to do to make a new page is make the content page. But my problem is if I send out a link for someone to look at, it only loads the content page and not the frame set. I thought I could use javascript to determine if the frame set is present and if not load it. But I can't seem to find a way to sent variables from one frame to another. Also if a user clicks a link I would like my flash controller to reflect it.

[Code]...

View 1 Replies View Related

Refreshing Bottom Frame From Top Frame

Aug 9, 2004

I need to know how to refresh a bottom frame TO a specific dynamic URL from my top frame (meaning the code has to be in the top frame) say every 5 seconds. The top frame will be a php file as I need DB values. But I believe the frame thing is done via javascript. This ain't working so far, it only loads the first URL at not the rest. Is there the ability to refresh to a specific url in a target frame. Code:

View 5 Replies View Related

Frame.contentWindow Vs Frame.contentDocument?

Feb 19, 2009

One more question about manipulating iframes. In a script I've looked through to investigate AJAX file uploads, there is this technique for accessing the contents of an iframe:

Code:
if(frame.contentWindow)
{
var thebody = frame.contentWindow.document.body;
}else if(frame.contentDocument)
{
var thebody = frame.contentDocument.document.body;
}

I haven't been able to find much info on contentWindow and contentDocument. In fact, other sources I've found talk only about using contentWindow to access an iframe's contents, ignoring contentDocument completely. What is the difference between the two, and what browsers is the contentDocument check targeting? Any modern browsers, or is this a backward compatibility thing?

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved