[DYNIFS] Working on test page but not on my site
 
 
Post new topic   Reply to topic   printer-friendly view    phpMiX.org Forum Index -> Widgets Discussion -> Javascript Snippets
View previous topic :: View next topic  
Author Message
nightmare sasuke
Apprentice
Apprentice


Joined: 26 Jun 2006
Posts: 5

PostPosted: Mon Jun 26, 2006 5:51 am    Post subject: [DYNIFS] Working on test page but not on my site Reply with quote

I'm using a search script for my website called freefind. It's the best I could find. The only problem is, when you search, it directs you to their domain, whereas I want the page to be included in my main content box.

I asked my friend for help, and he edited it so that when you click "search" it takes you to a page uploaded to my website, which contains an iframe. However, he did not know how to make the iframe auto-expand.

I have been searching all over the Internet for a couple of hours, tried many scripts, and none of them worked. I found the JavaScript on this website, and it works on my test page, but it will not work on the page that I need it to work.

My main web page is: http://www.example.com/.

Under the image "Search this Site" is the search form. When you click search it takes you to: http://www.example.com/index.php?id=search.

The search.php page contains the iframe. When you view the page, the iframe appears for a second, and then disappears. I'm not even sure if it is auto-expanding as it is supposed to.

Why is this? Can someone help?

The content for search.php is:

Quote:
<?php
$iframeurl = "http://search.different-domain.com/find.html?id={$_POST['id']}&pageid={$_POST['pageid']}&mode={$_POST['mode']}&n={$_POST['n']}&_charset_={$_POST['_charset_']}&bcd={$_POST['bcd']}&query={$_POST['query']}";
?>
<iframe width="100%" height="200" id="myiframe" name="myiframe" src="<? echo $iframeurl; ?>" onload="DYNIFS.resize('myiframe')" scrolling="no">Sorry, your browser doesn't seem to support IFrames!</iframe>


My main page has the URL to the dynifs.js file in the header.

If you need to know anything, ask me.

I'd like to fix this as soon as possible.

Thanks
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Mon Jun 26, 2006 6:23 am    Post subject: Reply with quote

It doesn't work because the page that have the IFrame in it (your site) and the page within the IFrame are located on completely different domains.

The browser is blocking the script from accessing the properties of the IFrame'd document and it is probably reporting an "Access Denied" error.

There is nothing we can do about it, maybe the service provider doesn't allow that...

Try using Google for Search. They allow you to customize the look an feel of the search pages and you could also get an AdSense account (to make a little money out of visitor clicks). If you don't like Google, then look at Yahoo! They also provide this service for free.

PS: I have changed the topic title to something more suitable. Also, I have modified the links, the original ones aren't relevant. If you wish to link to your site, you may want to use your signature or the website field in your profile.

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
nightmare sasuke
Apprentice
Apprentice


Joined: 26 Jun 2006
Posts: 5

PostPosted: Mon Jun 26, 2006 6:31 am    Post subject: Reply with quote

If I use a regular iframe it links to the page correctly. There is no way to make the iframe autoexpand?

If not, where can I download this Google Search script?
 
Back to top
View user's profile Send private message
nightmare sasuke
Apprentice
Apprentice


Joined: 26 Jun 2006
Posts: 5

PostPosted: Mon Jun 26, 2006 6:37 am    Post subject: Reply with quote

markus wrote:
It doesn't work because the page that have the IFrame in it (your site) and the page within the IFrame are located on completely different domains.

The browser is blocking the script from accessing the properties of the IFrame'd document and it is probably reporting an "Access Denied" error.

There is nothing we can do about it, maybe the service provider doesn't allow that...

Try using Google for Search. They allow you to customize the look an feel of the search pages and you could also get an AdSense account (to make a little money out of visitor clicks). If you don't like Google, then look at Yahoo! They also provide this service for free.

PS: I have changed the topic title to something more suitable. Also, I have modified the links, the original ones aren't relevant. If you wish to link to your site, you may want to use your signature or the website field in your profile.


If the "browser is blocking the script from accessing the properties of the IFrame'd document," then how come it shows up in the frame as long as I do not use the script?

I can get it to work if I define the height; however, I need it to auto-expand.
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Mon Jun 26, 2006 6:38 am    Post subject: Reply with quote

nightmare sasuke wrote:
If I use a regular iframe it links to the page correctly. There is no way to make the iframe autoexpand?

Your regular IFrame works because there is no javascript involved. However, to dynamically change the height of the IFrame we need javascript, which needs to read the height of the inner document, which is what the browser blocks (for security reasons). So, the answer is No, I'm afraid.

nightmare sasuke wrote:
If not, where can I download this Google Search script?

http://www.google.com/intl/en/services/websearch.html

Wink

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
nightmare sasuke
Apprentice
Apprentice


Joined: 26 Jun 2006
Posts: 5

PostPosted: Mon Jun 26, 2006 6:45 am    Post subject: Reply with quote

Just curious, but will the main search page of this Google script appear in MY content box, or does it link you to a separate page? If it links you to a separate page, I'll probably just stick with the script I have now, without an iframe included.

Unless, of course, I could link to the google code via iframe. What do you think?
 
Back to top
View user's profile Send private message
markus
[Administrator]
[Administrator]


Joined: 28 Jul 2003
Posts: 1124

PostPosted: Mon Jun 26, 2006 6:57 am    Post subject: Reply with quote

You have probably seen this somewhere else. Google AdSense for Search allows you to create a form such as the following:
Google
Web www.phpmix.org

You can change the look of the form as long as all field are kept. It may open on the same page or on a new window. On that page you can use your own logo and customize the colors of text, links, etc. It can be customized from an online page Google provides.

 
 
_________________
http://www.phpmix.org
 
Back to top
View user's profile Send private message
nightmare sasuke
Apprentice
Apprentice


Joined: 26 Jun 2006
Posts: 5

PostPosted: Mon Jun 26, 2006 7:00 am    Post subject: Reply with quote

Thanks. I'll try it. 
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    phpMiX.org Forum Index -> Widgets Discussion -> Javascript Snippets All times are GMT + 1 Hour
 
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum