January 7, 200422 yr 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?
January 8, 200422 yr Author 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?
January 8, 200422 yr Hi, could this be the old issue of leaving out the "<!--", "-->" as Filemaker ignores stuff within comment tags? regards, jeff
January 8, 200422 yr 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
January 9, 200422 yr Author 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!
February 2, 200421 yr removing suggested tags will not change anything as far JS fuctionality is concerned
February 2, 200421 yr 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!
Create an account or sign in to comment