PBainbridge Posted January 7, 2004 Posted January 7, 2004 I have a page conatining a form to carry out a search and displaying results of an earlier search (search.html). However it is necessary to redirect users arriving at this page according to their browser (search2.html for IE5+, search3.html for Safari, etc). How can I carry the results of the original search onto the page to which they have been redirected but not to the new search results page (search_results.html). Is there some way of including an [FMP-Link] tag into the redirect javascript in the header? The browser seems to stall on search.html when I make [FMP-Link]&-Format=search2.html my redirect url. Does anyone have any suggestions?
Garry Claridge Posted January 7, 2004 Posted January 7, 2004 Show us your Javascript. Good Luck. Garry
PBainbridge Posted January 8, 2004 Author Posted January 8, 2004 In response to Unable, you're absolutely right. As you point out the correct tag should be [FMP-Link: r] to omit the original format file - that was a typo on my part I'm afraid. The javascript detects IE or Safari browsers and redirects accordingly, the default being for Netscape and others. The following works fine but obviously loses the FM results that are displayed on the original page (search.html) <script type="text/javascript"><!-- function Is() { agent = navigator.userAgent.toLowerCase(); this.major = parseInt(navigator.appVersion); this.minor = parseFloat(navigator.appVersion); this.ie = ((agent.indexOf("msie") != -1)&& (agent.indexOf('opera')==-1)); this.winie = (this.win && this.ie); this.ie3 = (this.ie && (this.major < 4) && !this.ie6); this.ie4 = (this.ie && (this.major == 4) && (agent.indexOf("msie 4")!=-1) ); this.ie401 = (this.ie && (this.major == 4) && (agent.indexOf("msie 4.01")!=-1) ); this.ie4up = (this.ie && (this.major >= 4)); this.ie5 = (this.ie && (this.major == 4) && (agent.indexOf("msie 5")!=-1) ); this.ie51 = (this.ie && (this.major == 4) && (agent.indexOf("msie 5.01")!=-1) ); this.ie55 = (this.ie && (this.major == 4) && (agent.indexOf("msie 5.5")!=-1) ); this.ie5up = (this.ie && !this.ie3 && !this.ie4); this.ie6 = (this.ie && (agent.indexOf("msie 6.0")!=-1) ); this.mac = (agent.indexOf("mac")!=-1); this.safari = (this.mac && (agent.indexOf("safari")!=-1)); } var is = new Is(); if (is.ie4up||is.ie5||is.ie55||is.ie5up||is.ie6) //for IE window.location.href="/FMPro?-db=db.fp5&-lay=websearch&-format=search3.html&-view" if (is.safari) //for Safari window.location.href="/FMPro?-db=db.fp5&-lay=websearch&-format=search2.html&-view" //--></script> I tried changing the redirect to: window.location.href="[FMP-Link: r]&-format=search2.html" or window.location.href="[FMP-Link: r]&-format=search2.html&-view" Both attempt to redirect but either it has completely stalled or I'm just not patient enough (in which case its taking too long for our clients anyway). Any thoughts?
Jeff Spall Posted January 8, 2004 Posted January 8, 2004 Hi, could this be the old issue of leaving out the "<!--", "-->" as Filemaker ignores stuff within comment tags? regards, jeff
Garry Claridge Posted January 8, 2004 Posted January 8, 2004 If you try it without Browser detection is the speed better? Does the speed vary for different Browsers? I guess it is a case of finding what is causing the slowness. Try it without the "-Lay". Good Luck. Garry
PBainbridge Posted January 9, 2004 Author Posted January 9, 2004 Hi Jeff I hope that is not the case, as that would make javascript useless in this scenario, and I will have to carry out the browser detection at a point before the initial search is sent to FM. It appears that Explorer ignores the [FMP-Link] redirect completely, while Safari attempts but fails to redirect, so unless you have some workaround hidden up your sleeve, I'll try a different approach. Thanks for your help guys!
Leb i Sol Posted February 2, 2004 Posted February 2, 2004 removing suggested tags will not change anything as far JS fuctionality is concerned
Leb i Sol Posted February 2, 2004 Posted February 2, 2004 also consider if ur using frames and perhaps have a script to block pop-ups. If the target to frame is not specified it will behave as a new window. But above all....Why are u redirecting? there are ways to achive cross-browser-platform compatibility without redirection...it depends on design. window.location.href="[FMP-Link: r]&-format=search2.html" VS. window.location="[FMP-Link: r]&-format=search2.html" All the best!
Recommended Posts
This topic is 7669 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now