Welcome to TalkGraphics.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Location
    Reading, United Kingdom
    Posts
    168

    Default JavaScript Problems with X10 Multi-variant Site

    Just started testing multiple variants with dynamic content in X10.

    First problem, which should be easy to duplicate, is that all Javascript added to the page <head> appears multiple times, which shouldn't break the page but equally shouldn't happen.

    Second is that the dynamic content, which should fill a placeholder using an AJAX call, works at desktop size but doesn't happen at mobile/tablet size. No errors are raised and the AJAX call is made corectly but then nothing.

  2. #2
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,847

    Default Re: JavaScript Problems with X10 Multi-variant Site

    It appears to occur once for each Variant.
    If you add content to the Site head, you only get one instance.

    The repeated code could be a problem for JavaScript variable instantiations.
    It is not a good place to be.

    Re the AJAX, it is possible the Placeholder needs to be renamed for each Variant? It could be populating the wrong Variant.
    I would create different Names as the target for each one separately.

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  3. #3
    Join Date
    Oct 2003
    Location
    Reading, United Kingdom
    Posts
    168

    Default Re: JavaScript Problems with X10 Multi-variant Site

    Thank you, looks like you are right about the wrong placeholder, giving them different ids has got the small variant working. As the large variant is now broken I suspect all the dynamic content will have to be served with ids suited to the variation displayed.

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •