Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

FMP-Link with browser redirection

Featured Replies

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?

From the CDMLRdb:

[FMP-Link: r]

Show us your Javascript.

Good Luck.

Garry

  • 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?

Hi, could this be the old issue of leaving out the "<!--", "-->" as Filemaker ignores stuff within comment tags?

regards, jeff

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

  • 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!

  • 4 weeks later...

removing suggested tags will not change anything as far JS fuctionality is concerned

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

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.