Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Javascript problem

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 2442 Views
  • d_armin
    Avatar
    Community Member
    8 Posts

    Javascript problem Link to this post

    Hi,
    i added some javascript code (google gadget and javascript menu) in my page template. In IE it's all perfect shown, in FF not. In FF there's no error message and no javascript results. When i save the source of the page as a html document, and open it with FF, then everything is perfect. Where is the problem?

    Thanks

  • d_armin
    Avatar
    Community Member
    8 Posts

    Re: Javascript problem Link to this post

    Partially solved. ContentNegotiator::disable(); solved the problem. It's all shown in firefox now. The site is now ca 30% slower. Is it because i disabled the content negotiation or because of the javascript? The formating of the site has changed now a little. Maybe now someone knows where my problem was with the javascript, so i can solve it and enable the ContentNegotiator.

    Thanks

  • Sean
    Avatar
    Forum Moderator
    921 Posts

    Re: Javascript problem Link to this post

    ContentNegotiator just disables the use of XHTML DOCTYPE unless the XML header is present. Disabling ContentNegotiator turns off this function completely - so it shouldn't really affect much on a standard web page.

    You could try adding the XML tag, just before the DOCTYPE:

    <?xml version="1.0" encoding="UTF-8"?>

    ...then reload the document in Firefox. Make sure you comment out your ContentNegotiator::disable(); for this.

    You'll get XML parsing errors if there's any structural problems.

    Hope this provides some leads,

    Cheers,
    Sean

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: Javascript problem Link to this post

    i don't see how changing the doctype would make the site slower on rendering/javascript-execution. Content-Type: text/xml is probably parsed slightly different in browsers, but that shouldn't have a huge impact. having "standard mode" or "quirksmode" is also just a CSS-rendering-switch, shouldn't have any speed-impact. long story short: most likely its the javascript itself slowing down the site

  • d_armin
    Avatar
    Community Member
    8 Posts

    Re: Javascript problem Link to this post

    Hi,
    Thanks for fast reply
    the javascript is slowing the site down. I measured it
    But, why javascript won't work on FF when i enable the ContentNegotiator.
    In IE is everything ok.What's wrong?

    2442 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.