codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  calling a method in another web page  Archive Import (dead meat) at 16:32 on Monday, July 21, 2003
 

hello im having trouble.
how can i call a method from ex: 1.html where the method ex: $%#()
is located in another webpage ex: 2.html


please help. i am very frustrated.

  Re: calling a method in another web page  Troy Wolf at 15:48 on Friday, August 01, 2003
 

Sorry this is so late. I believe the pages must be related. This means that one page needs to have spawned the other page. Or both pages are children of a common parent window. For example, if you have a window (pageA.html) that opens a second window (pageB.html), pageB.html could have javascript that calls a javascript function in pageA.html:

self.opener.MyFunction();

Also, if a parent window opens 2 children windows, you can communicate between the 2 child windows through the parent window.

When dealing with framesets, which I haven`t in quite a long time, you can reference the frame`s object model. For example, you always have a window called "top" -- this is the browser`s default. So then if you have a frame called "left" and a frame called "right". The left frame can call a function in the right frame like so:

top.right.MyFunction()

There may be other options, but this is what I can offer from my experience.
Troy Wolf: site expert
SnippetEdit Website Editor


  Re: calling a method in another web page  Elain at 04:19 on Friday, January 14, 2011
 

Very useful info, it is so lucky for me to find about the answer when i met a question, thank you!
_______________________________________________
decompiler for mac|tree menu|flash banner








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: Doubles .toString Error: double cannot be dereferenced.
•  Re: What VBA code can I use to extract the IP Address
•  Re: difference between activex dll and an exe
•  Re: New user, trying to figure out how `find` works....
•  Re: adding a querystring parameter in a button click event
•  Re: onclick thumbnail images in gridview or datalist
•  Re: MDI form open size and location
•  Re: where can i download javax.speech package
•  Re: need help with main()


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2011