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.

Javascript in XSLT stylesheets

Featured Replies

My Javascripts that I have put in xslt stylesheets don´t execute. I have put them between the tags. Does anyone have an idea why this doesn´t work?

Can you see any errors in the "Javascript Consol" in Safari?

Garry

Did you use comment tags between ?

If yes: You can't use these, because they are comment tags for XSLT. Use and instead.

  • Author

Well, yes, since they are part of the script. If I change or delete them the page won´t load at all. Here´s the script:

Maybe because of the < in this line

if (year < 2000) ... ?

< would be interpreted as start of a new tag.

What you can do is to move the the script out of the XSLT file, e.g. use as an external file that is included and referenced by

  • Author

Took me a while to enable the debug-menu in Safari...

No, no errors is displayed in the console when loading the page. It should simply return the proper date and year, but no result at all is displayed.

  • Author

Putting a reference to a separate file didn´t change anything, still doesn´t execute.

/Mattias

Does XSLT also work without the JavaScript code?

  • 2 weeks later...
  • Author

Yes, the page works fine, it´s just that the javascript doesn´t execute...

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.