Yahoo User Interface and WordPress, Javascript Array Problem (3 posts)

  1. WhisperPress
    Posted 5 years ago #

    I'm using a YUI 2 calendar widget within a wordpress installation, and have a problem printing a date array.

    Here are the configuration options of the calendar, to see how the dates are passed as a non-array, for example "11/12/10,04/12/11"

    Here is the code I'm using, with an anonymous function:

    When the page loads, it's completely blank except for the date_array which is printed at the top of the page. Does wordpress need some additional work around for this to function?

    I've already done enqueues for several other javascript pieces, however I find it strange that the calendar loads perfectly with the dates highlighted if I pass in "11/12/10,04/12/11", but does not work if I try to use the function DateAnon()


    I appreciate any and all help!


  2. WhisperPress
    Posted 5 years ago #

    I found the answer thanks to blast007 in #YUI on the freenode IRC.

    if you do a document.write after the page is loaded, it will overwrite your entire page

    you probably want to have a placeholder element (say, a div) that you then manipulate the contents of - or maybe you really just want to send that data to a debugger like Firebug

  3. WhisperPress
    Posted 5 years ago #

    Best Answer:

    Use DOM Manipulation methods instead of document.write


Topic Closed

This topic has been closed to new replies.

About this Topic