Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    JAVASCRIPTS






SuperbHosting.net & Arvixe.com have generously sponsored dedicated servers and web hosting to ensure a reliable and scalable dedicated hosting solution for BigResource.com.







How To Update One DIV Frame From Another?


I have two DIV frames...

<body>
<div id="leftcol"><?php include("navL.html"); ?></div>
<div id="content"><?php include("content.php"); ?></div>
</body>

and in the leftcol DIV frame, I have navL.html file loaded.

This is the content of the navL.html file...

HTML Code:
<script type="text/javascript">
<!--

function load(arg)
{
alert(arg);
document.getElementByID("content").src = arg + ".html";
}

//-->
</script>

<a href="#" onClick="javascript:load('test1');">test1</a>
<BR>

<a href="#" onClick="javascript:load('test2');">test2</a>
In there I have two links which I want to use to update the content DIV frame with either test1.html or test2.html depending on the link that is clicked, but somehow it is not working..


View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
Cannot Update The Frame
I used javascript to generate the HTML file and tried to update a
frame using this HTML file.

function handleButton1()
{
parent.location="http://localhost:8080/myservlet/testservlet";
// testservlet generate the HTML file.
parent.frame1.window.location.reload(true); // update frame1
}

But I have to press the button twice to see the update. I tried to add
a sufficient long delay between these two statements but no luck.

View Replies !   View Related
Directing Users To Full Frame Set And Proper Page In Main Frame?
I have a large site that uses a 3-frame set, Left=Nav, Top=Header,
Right=body. When doing searches on Google I see the individual pages
listed as links, and when you click it takes you to the individual page
instead of the main site with 3 frames. Last night I found some js code
that detects if the frames are loaded and then redirects the user back to
the main site, so the user gets the root site anytime they select only a
sub-page from google - this works fine, but, I would like to have the
scripting redirect them to the main site and the select the proper page in
the body.

So, anyone got a sample piece of code that loads the proper body page in
the main frame when doing a google search?

View Replies !   View Related
Go Back History Button On Top Frame That Affects Main Frame?
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 Replies !   View Related
Trying To Change JS Target From A Frame In A Frameset To An Inline Frame In An Html
We are trying to switch a page from a frameset (x2 frames) to a regular .html page with an inline frame. The javascript is in the main content area. It writes links to the side column frameset. My boss wants to do away with the frames and have the javascript write to the inline frame.

// Simple error check to make sure that there are markers in the file.
if (iNumMarkers != -1) {
// "For" loop which creates all of the inline JavaScript anchor tags
for (var i = 1; i <= iNumMarkers; i++) {
sTempString = sTempString + "<A HREF="javascript:parent.frames[1].seekToMarker(";
sTempString = sTempString + i + ")">";
sTempString = sTempString + document.MediaPlayer1.GetMarkerName(i);
sTempString = sTempString + "</A><BR>"
}
// Actual code which writes the information to the other frame.
parent.frames[0].document.open();
parent.frames[0].document.writeln("<HTML><BODY BGCOLOR="#ffffff">");
parent.frames[0].document.writeln(sTempString);
parent.frames[0].document.writeln("</BODY></HTML>");
parent.frames[0].document.close();

} else {

alert("There are no Markers in this file");
}
}

I don't know how to change the "parent.frames[0].document.writeIn to write in the inline frame. The inline frame's actual page name is: menu.html and the id of the inline frame is: menumarker. The inline frame is located in a page called: player.html

View Replies !   View Related
How To Read The Content Of A Frame From Anther Frame?
i have a page contain two frames, frame1 and frame2. how can i read
content of frame1 from frame2?

View Replies !   View Related
Breaking Out Of Parent Frame If Child Frame Changes URL
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 Replies !   View Related
How To Utilize Var In Frame A From Frame B (IE Does Not Play)
Here is the situation:

Frame set with two frames: jsLib & mainContent
*jsLib* contains variables that change and are dequired during the session
*mainContent* contains the pages the user looks at. From time to time they
contains js producing DOM elements and onload js as well.

The jsLib contains a function (see below) that modifies DOM elements that
are shown on the mainContent. In doing that it has to use a variable that
stays in place during the whole session.

I have got the above working totally ok in Gecko and guess what. Indeed, IE
5+ doesn't.

Using IE5+ I can initialize parent._staticTable but when I come back a
second time it still exists *but* rows does not contains any entries anymore.
Gecko just keeps the variable parent._staticTable inplace no worries but IE
seems to mess something up. I suppose the question is obvious.
How does one keep track of (in memory) values in IE? ...

View Replies !   View Related
Refreshing Bottom Frame From Top Frame
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 Replies !   View Related
Close Frame From Within That Frame
anyway, i have 2 frames. how can i close the top frame from a link within the top frame? i want the lower frame to be the only page displayed but i won't be able to know what the lower frame's url will be.

View Replies !   View Related
Value Of .src Does Not Update Within Iframe
I am trying to track links that are clicked on an "external" page that
resides within my iframe.

I am able get the INITIAL value of the iframe .src, however this value
does not update once the content has been updated by clicking the
external link. It keeps the original value of .src..

View Replies !   View Related
More Moo.Fx - Update Height
I need a way to update the height of an element using Moo.fx rather than use .toggle() to toggle between the height and 0.

The reason for this is it's on an AJAX search and so I need to update the height of the listing of results when a new search is made. As it is at the moment, with .toggle(), a user would have to submit the search twice in order to see the results (1st search would hide the results, 2nd search would show the results to the new size).

I've tried using setTimeout like so, but it still requires submitting twice...

setTimeout("sSearch.toggle()",100);
sSearch.toggle();

Actually it would probably be better to toggle the current results to height of 0 then show the new ones, but only on one search.

View Replies !   View Related
Update Iframe
Is it possible to refresh a iframe when a user changes the value of a select box. I want a user to be able to change a month and year option group and onchange it should refresh an iframe with a small calender in it.

View Replies !   View Related
Update Field
I'm trying to "combine" PHP and Javascript to a possible workaround.
I have a test form with two objects;

- a text field
- a drop down box; the items are stored in a MySQL table

In PHP I can adjust the items of the drop down box by submitting the form (button) and querying the results out of the database.

In Javascript I can do this without a button to submit the form.

But I have to include all possible values (>1000) for the items in the script...
Is there I way to combine the two (on leaving the text field, the items in the drop down box should being build from a MySQL database using the value of the text field...)
Can anyone help me out here?

View Replies !   View Related
Update 1st Window
i have 3 windows

1st window
a. top frame - add record
b. bottom frame - list of records added in top frame

2nd window ( triggered by showModalDialog in 1st window (b))
user select record from the list in 1st window (b) to remove, when the user
press "YES" button, then goto the 3rd window for execution.

3rd window - enforce the action to delete the specified record in SQL
database

My problem is how i can use the 3rd window to trigger the reload of 1st
window or 1st window bottom frame so as the users can see the updated list
after their actions.

View Replies !   View Related
Update DIV Height
I have a fav.css file with class .favBg

.favBg
{
 border: 0px;
 padding: 0px;
 margin: 0px;
 width: 100%;
 position: absolute;
 background-color: #000000;
 opacity: 0.5;
 filter: Alpha(opacity:50);
}

Here i have made a javascript that calculates both window height and scroll height, and another function which adds both the window height and scroll height, so i got total page height.

JavaScript Code:
function pHeight()
{
  var pHeight = scrollHeight() + windowHeight();
  return pHeight;}

what I want to do is to update the height of class .favBg with the value of pHeight(), as each page in the site are of different length. Yes, i'm trying to do 100% page height faded background, Just like in Sitepoint Marketplace's "My Shortlist". Basically I'm doing a "My Favorites" list just like Sitepoint Marketplace's "My Shortlist".

View Replies !   View Related
Help With Form Auto Update
For instance, Box A has a blank entry and I enter in 5. Box B I enter in 6
so in Box C it should automatically give me 11 (if the code I put in is to
add box A and B). Then in Box D I put in 3 (say to subtract from A and B
combined) so then Box C adjusts to give me 8.

Don't worry about the math as that's all taken care of it, I just need to be
able to know how to update on the fly like this.

View Replies !   View Related
JS - Checking A File Update
I have a site with a news pages and I'd like the navigation to include a
blinking 'NEW!' when that page has been updated within the last three days.

It works fine for the one page (if you're on the news page, it works great)
but I can't figure out how to check the time/date stamp on a file other
than the one currently loaded ...

View Replies !   View Related
How To Update Session Variable Using JS
there a way of updating session variable in JS?

View Replies !   View Related
IE UI Doesn't Update In Mousemove Event
I have implemented some custom scrollbars and implemented drag&drop
functionality to update the position of the scrollbar while dragging.
The problem I am having is that in IE the scrollbar position doesn't
update very good while dragging fast. It seems that the mousemove
events happen so fast in IE that it forgets to "repaint" the updated
position on the scrollbar. Note that in Firefox it works perfectly
fine.

To solve this I thought about intercepting the mousemove calls and
only call the listener with the mousemove event argument only once
per interval (for example 100ms). I implemented this using
window.setTimeout and stumbled upon another problem.

The event variable (containing properties such as screenX and screenY)
is "saved" before the setTimeout delay and passed to the listener in
the callback function. However it seems that the event object is
reused (in Firefox and IE), so the properties do not contain the same
values as when the timeout began. You can probably imagine the problems
that this causes.

To solve this I needed to copy/clone the event object. Now I ended
up with some weird event copy function.

function cloneEvent(evt)
{
// For Firefox:
//var result = document.createEvent("MouseEvent");

// For IE:
var result = document.createEventObject("MouseEvent");

/* For Firefox:
result.initMouseEvent(
"mousemove",
evt.bubbles, // PRBool canBubbleArg
evt.cancelable, // PRBool cancelableArg
evt.view, // nsIDOMAbstractView viewArg
evt.detail, // PRInt32 detailArg
evt.screenX, // PRInt32 screenXArg
evt.screenY, // PRInt32 screenYArg
evt.clientX, // PRInt32 clientXArg
evt.clientY, // PRInt32 clientYArg
evt.ctrlKey, // PRBool ctrlKeyArg
evt.altKey, // PRBool altKeyArg
evt.shiftKey, // PRBool shiftKeyArg
evt.metaKey, // PRBool metkeyArg
evt.button, // PRUint16 buttonArg
evt.relatedTarget // nsIDOMEventTarget relatedTargetArg
);
*/

// For IE:
for (var i in evt)
{
try
{
result[i] = evt[i];
}
catch(e) {}
}

return result;
}

It all works now, but I wanted to know if there is a cleaner/easier
way to solve my original problem. Some questions are:

1) Is there a way to reduce the rate that IE triggers mousemove events?
2) Can I force IE to update the UI before a new event is called?
3) Can I copy the event in IE with a function such as Firefox?

View Replies !   View Related
Image Update & DOM For Windows CE .NET 4.1
I'm having a problem of not being able to dynamically update images on a webpage when viewed using pocket internet explorer on a Windows CE .NET 4.1 machine. This works with Windows CE 5.0 however we need to be able to run this on 4.1. Does anyone know why this won't work or know of a work around? Code:

View Replies !   View Related
Force Page Update?
I have a script that parses window.location.hash to figure out which xml
file to load. The xml files populate a page on a framed site. The code works
correctly to a point.

If I have a seperate html page to support each xml it works. I would like to
eliminate the individual html pages becuase only one should be needed.

When I use one page the first link works, then the second one does nothing
(doesn't refresh the frame). If I click to a static image for the frame then
click the next xml link it works.

What can I do to force the frame to update? I am clicking on a HREF link
that should re-load the html page, but with the new xml data.

View Replies !   View Related
Javascript/php Partial Update
How can I partially update a page using javascript if javascript is
available, but do a full update if it's not, using php?

View Replies !   View Related
Update Layer Without Refresh
I have come to my whits'-end looking for some code to update a layer with a timer, with data from another page.

I know this is possible, I have seen it before, but wouldn;t have a clue where :'(

Has anyone done this before, or could someone point me in the right direction?

View Replies !   View Related
How To Update Cached .js Files?
I have two .js files that are used on several of my pages. I made some
changes in one of the files. When I call the pages, the old functions
are called because of the browser's cache. What is the best way to
update the browser's cache with the newer version of my .js file?

View Replies !   View Related
Input Box Auto Update
I have 2 input box on my form...i would like input box #2 to be
updated automatically onces data entry in input box #1 is completed.

I would be greatful if some could guide me through this. I'm a php guy
with little javascript knowledge.

View Replies !   View Related
AJAX Update Page
I followed the video tutorials on this site - pretty good. I'm now able to delete records and remove the tr on he fly. Im also able to insert a new record i my db, i the background. But how do i update my page so the post shows up? Code:

View Replies !   View Related
Easy Site Update Form
Is there a way to change a javascript's output on a website without directly manipulating the source code? Just by entering some info in a form, then hitting submit. Then it automatically changes the content of a website.

What I want to happen is to change some text (specifically a news ticker) on my javascript, located in between the head tags, just by inputting new information on a form which automatically replaces the old one.

View Replies !   View Related
How Can I Update A Form In Real-time?
I'm making a survey where every question has a numeric value assigned to it, and as the user clicks on a checkmark button to approve (or uncheck to disapprove) the values add or subtract to give a total at the bottom of the page.

Basically, it's a spreadsheet but with fixed values for each row instead of being able to type them in.

I can do this easily with php, but only if the user clicks the submit button. I was hoping to find a way to do this real-time.

I'm not looking for someone to do this for me, but can someone point me in the right direction of a tutorial or something that is similar so I can build this into my program?

View Replies !   View Related
Automatic Website Update Message
Is there any sort of js code that i could put on my website, say on the home page, that when i update the website, it displays that date of when the last update was?

Is that at all possible?

View Replies !   View Related
OnChange Of Listbox To Update Link?
I have a PHP page that generates a list box with several options in it.

I would like to have a "view" link next to the list box. When the user
changes the contents of the list box, I would like the view link to
update to point to the image representing that selection. So for
example, if the list box held names of images I would want the view link
to always point at the correct image.

To further complicate this matter, the selections of the listbox are in
PHP variables.

I basically have little to no experience with javascript and could use
some guidance in figuring this out.

View Replies !   View Related
Update Available Feeds On Event Change
This kinda deals with XML and javascript, but what i'm having issues with is that i have a script that checks the xml structure at a certain point. "campaign->vehicles->vehicle->offer->template" and then will display other fields based on the select box value chosen at that node item.

The issue is that there could be duplicates of the "vehicles" grouping and the script i have doesnt work when it see's multiple instances of this. Is there a way so that the functionality could still work and allow for multiple instances of the "vehicles" node? Code:

View Replies !   View Related
Update A Hidden Form Value From A List Box
I have a page with 2 forms on, namely form1 and form2!!

In form1 there is a listbox with a drop down of IDs. Now if the user selects a different ID in that list, form2 hidden variable (qualstatus) needs to be updated with the new ID which was selected in form1. I have tried the following.

function changequal() {
document.form2.qualstatus.value = document.form1.qualstatus.value
}

with a

<select name="qualstatus" id="qualstatus" onChange="changequal()">

however this does not seem to update the value of

<input name="qualstatus" type="hidden" id="qualstatus" value="<%=(rsAction.Fields.Item("qualStatusID").Value)%>">

View Replies !   View Related
How To Make Javascript Update IFRAME SRC?
How can I make an onchange event update the src for an IFRAME? I would like
to do it without reloading the page, is this possible?

View Replies !   View Related
Create/Update Php Session With Javascript
I am trying to create/update a Php Session with Javascript to confirm
if users have Javascript enabled.

My first thought was to create a Javascript that writes a script tag
referencing a php page, which sets a $_SESSION variable.

javascript.js:

<script type="text/javascript">
<!--//
document.write('<s'+'cript type="text/javascript"
src="javascript.php"></s'+'cript>');
//-->
</script>

javascript.php:

<?php
session_start();
$_SESSION['javascript'] = 'enabled'
?>

I can see that both the javascript.js and javascipt.php files are
executing from the web logs, but when I try to query the
$_SESSION['javascript'] variable from another page $_SESSION is empty.

Is it possible to create/update a Php Session with Javascript?

Might it be done using URLEncoded URL, Javascript XMLHttpRequest, or
something of the like?

View Replies !   View Related
Update JS To Work With A Strict DOCTYPE
I am now using a strict !DOCTYPE and want to ensure that my pages comply. The Javascript I used to use no longer works - how can I seperate it from the structure of the page?

<input name="rdo1" id="rdo12" type="radio" checked="checked" value="didnt"

<textarea name="txtarea1" id="txtarea1" cols="20" rows="5">

<script type="text/javascript">

/*
Clear default form value
*/

function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
}
</script>

View Replies !   View Related
Cant Update Dom After JQuery Ajax Request
I'm trying to update my page with either a yes or a no, I'm using Ajax for the request to the server. The request works perfectly, however when I try to update the DOM with the server response using $(this).text(response.waiting); and $(this).html(response.waiting);.

I've tried alert(response.waiting); and returns a valid response. So, the problem probably stems from the DOM.

$("#data a.waiting").each(function(i){
$(this).click(function() {
$(this).html('<img src="../img/loading.gif" id="loadwait" alt="Loading..." />').fadeIn("slow");
$.ajax({
type: "POST",
url: "waiting/ajax/",
data: "id=" + $(this).attr("name"),
dataType: "json",
success: function(response) {
$("#loadwait").hide();
$(this).show();
$(this).html(response.waiting);
}
});
});
});

View Replies !   View Related
Update Date/Time Button
So I am trying to get an update date/time script to work with the server time, or a given time zone (-5 GMT). Right now, the script below references the local machines time. Code:

View Replies !   View Related
Update A Page On Receiving A Message From The Server
i am trying to put some code within my js such that, when the server
"sends it a message" it refreshes the page. now i have the refresh part
of things. the place where i am stuck is, how can my server (tomcat, am
using a java web app) send a very small piece of info to the js which
when it receives it, refreshes the page.

View Replies !   View Related
Javascript Onblur Webpage Update Issues.
The issue I am dealing with here is that I am trying to update a
webpage when the focus goes away from the page. For example I have a
xml database and a form that users add data to. Put simply anyways. The
problem is I cannot find a way to use the windows.onblur or onblur with
any other object that updates the page when it is supposed to.
I had some simple code that updates the XML and attempted to use
onblur.

I was using SetTimeout to update the page every minute or so. The
update method works fine, I just cannot come up with the right onblur
code that will only update the page when the focus is lost. If the page
has focus at all i would like the updates to stop, and resume once it
loses focus. It contains input fields, and drop down boxes, etc..and I
think that messes with onfocus onblur of the window. Could someone
point me in the right direction on this.

View Replies !   View Related
E-commerce - Checkbox - Pricing Update - Query
I want to change the existing code of our company e-commerce site so that the pull down menues are now checkboxes (will make life easier for sales to work with).

The pull down menu's must automatically submit, as the pricing changes with each selection.

Is there a way of auto submiting when a checkbox is ticked / unticked? Have tried using the "onChange=" that I nicked from the pull down...

Current checkbox code below.

View Replies !   View Related
Update All Select Boxes On Page Using Javascript
I am trying to update all Select boxes on a page dynamically using
javascript, I simple want to change the selected item in each select
box when a tick box is pressed on the page. Each Select box is named
in the same convention ie. ddl_DeliveryStatus_ and then the recordID
and contains the same options in the same order. The number of select
boxes changes every time the page is loaded as this is all built using
ASP linked to a database.

I am hoping there is an array or collection or something similar I can
simply reference to do this, but an struggling to find the answer.

View Replies !   View Related
Possible To Update Multiple Things With Ajax.Updater?
I'm using the script.aculo.us library and am trying to update multiple divs on an action. Right now when you "login" to a form it replaces the div around the form with a message but I'd also like it to update other divs on the page.

View Replies !   View Related
JavaScript Form Field Value Update Dilemma
I'm doing an ajax call to a remote php file... it returns a value fine,
and even enters a value into a text field on my form. The problem is,
right after the function call to the ajax function, I do an alert of
what the field value is, and it doesn't recognize the field value has
been changed. Two caveats:

1 - It will recognize the last call's change
(if I run it a 2nd time, it'll see the 1st call changes)
onBlur="ajaxCall(document.form1);alert(document.form1.ajax Field.value);">

2 - It'll recognize the current call's change if I set a 2 second
timeout
onBlur="ajaxCall(document.form1);setTimeout('checkFields(d ocument.form1)',2000);">

It seems, although I can see the text field getting updated,
programmatically speaking, it isn't reflecting it until everything is
done... including any alerts and such.

It's weird seeing the empty alert popup, when I can see the value in
the text field underneath it.

View Replies !   View Related

Copyright © 2005-08 www.BigResource.com, All rights reserved