
![]() |
perkiset
This outlines how you can essentially do "cross domain
AJAX" using iFrames rather than the XMLHTTPRequestor. This technique definitely has a place at the table.http://developer. apple.com/internet/webcontent/iframe.html/p dirk
Thanks for the link, Ed.
Yesterday I have tested a search function which is displaying the results on the same page where the function is called in an iframe. This is simple (as always if you know what you have to do ![]() But now I want to display the search results in an iframe of another page (another browser window). The page should be a .html page, no . phpor .cgi. Don't know if this is doable.Currently my tests are not working. perkiset
Hey Dirk -
I'm gonna post a JavaScriptwrapper around an iFrame call that looks likeAJAXbut is not hindered by cross domain stuff. I don't know if it will immediately apply, but I think conceptually it may help. But perhaps I'm way off base here - are you saying that you get results from an iframe on browser window (A) and want to display them in browser window (B)? Is this window B already open or not? Why can't browser window (b) go get it's own damn data?![]() /p dirk
I will start a search on browser window a and the results should be displayed on browser window b in an iframe.
The following solution is working, but it seems to be too complicated: Submitting the search request executes a script which stores the search phrase in a temporary file and opens a new browser window (b) which loads a static HTML page. The iframe of the new page execute another script which reads the tempary file to get the search parameters. Then the database is queried and the results are displayed in the iframe. perkiset
By "temp file" I assume you mean a cookie? If I had to talk between two browser windows I'd use a cookie... but other than that, give what you're describing you're trying to do I don't know that I see any less complicated way. There is a nice cookie class in the
Javascriptrepository, if you need one./p dirk
I meant a normal file, no cookie. But that would imply some session handling.
Otherwise a second visitor could get the search results for the first visitor. Found a simpler solution: The URL of the second page is build with a query string, so the search parameter can be appended, like: http://domain.com/page-b.html?param=keyword Using JavaScriptin page-b.html I can parse the querystring and build the iframe source URL.<script type="text/ javascript">var param=unescape(location.search); param=param.substring(1,param.length); iframe_url = "search. php?" + param;document.write('<iframe src="' + iframe_url + '"></iframe>'); </script> The script search. phpqueries the database and displays the results in the iframe.perkiset
quote author=dirk link=topic=190.msg1214#msg1214 date=1178914726 I meant a normal file, no cookie. But that would imply some session handling. Otherwise a second visitor could get the search results for the first visitor. OH WOW - you meant you're storing a file on your server for the second browser? I meant drop a cookie on the client machine so that the second browser window could pick it up... now I'm really confused...can you PM me more details and I could look at where you're going? I suspect that I can assist if you are willing to share a bit more. /p |

Thread Categories

![]() |
![]() |
Best of The Cache Home |
![]() |
![]() |
Search The Cache |
- Ajax
- Apache & mod_rewrite
- BlackHat SEO & Web Stuff
- C/++/#, Pascal etc.
- Database Stuff
- General & Non-Technical Discussion
- General programming, learning to code
- Javascript Discussions & Code
- Linux Related
- Mac, iPhone & OS-X Stuff
- Miscellaneous
- MS Windows Related
- PERL & Python Related
- PHP: Questions & Discussion
- PHP: Techniques, Classes & Examples
- Regular Expressions
- Uncategorized Threads