Iframe, Javascript, and PHP Tutorial
Moderator: General Moderators
Iframe, Javascript, and PHP Tutorial
decided to remove this. Is now considered obsolete and should be instead replaced by an Ajax or XAjax tutorial..
Last edited by infolock on Wed Sep 14, 2005 10:09 am, edited 17 times in total.
-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA
You check that?What you need to have/know before reading this tutorial :
1) PHP & HTML
2) Basic calling and naming conventions of Javascript.
3) A web server and php installed.
4) A browser that supports iframes and javascript ( Note : I do not cover Netscape, only I.E. Netscape users will need to do research on the ilayer tag. this is not a very hard subject, i just chose not to lengthen this tutorial more than I already have.. The IE version recommended is 5.0+)
Also, if it's locally hosted, make sure you navigate to localhost/file.php via a web browser, instead of double clicking the file.
Ok, fixed this problem as well.. I did the following.
Instead of writing
I wrote
and now it works, but just doesn't give the "Not implemented" error. But why?
Thanks
Instead of writing
Code: Select all
function ProcessAccount()
{
var Email = '<?=$email_address; ?>';
var Name = '<?=$firstname; ?>';
var Surname = '<?=$lastname; ?>';
window.parent.LoadTopFrame(Email,Name,Surname);
}
window.onload = ProcessAccount();Code: Select all
window.onload = function ProcessAccount()
{
var Email = '<?=$email_address; ?>';
var Name = '<?=$firstname; ?>';
var Surname = '<?=$lastname; ?>';
window.parent.LoadTopFrame(Email,Name,Surname);
}Thanks
This was due to an error on my part. When I first wrote this article, I just kinda zoomed through the code.. Since I'm used to php's function calls (ie, myfunction() ), i kind of implimented it with javascript. Sometimes this is ok, but when using a window.onload = myfunction(); command, this does not work and generates that type of error.Zooter wrote:and now it works, but just doesn't give the "Not implemented" error. But why?
Thanks
This has been corrected to be window.onload = myfunction; without the ()'s... Thanks feyd and zooter. The script has been updated to reflect these changes. Sorry to anyone to which this may have caused some confusion.
for those using javascript and wanting it to be M$IE compatible, here's something volka gave me that helps:
http://msdn.microsoft.com/library/defau ... frame=true
http://msdn.microsoft.com/library/defau ... frame=true
In FireFox this does not seem to work correctly.
In FF I get the error:
Error: parent.top.myform has no properties
Line: 10
I changed lines 10,11 and 12 from:
to:
Everything seems to be working, not sure what the implications are of this, it still works in IE.
In FF I get the error:
Error: parent.top.myform has no properties
Line: 10
I changed lines 10,11 and 12 from:
Code: Select all
parent.top.myform.Account.value = Account;
parent.top.myform.fName.value = Name;
parent.top.myform.Address.value = Address;Code: Select all
myform.Account.value = Account;
myform.fName.value = Name;
myform.Address.value = Address;