WordPress.org

Forums

calling javascript in jquery UI tab (2 posts)

  1. hankmoody
    Member
    Posted 3 years ago #

    Hi I really hope someone can help me as I am tearing my hair out. I built my clients site theme around the Jquery Post UI tabs plugin. The plugin is simply the wordpress version of jQuery's excellent ui tabs. My client is adamant that this should not change. I now need to embed a booking js booking calendar in one of the tabs (this is NOT a wordpress plugin as I couldn't find anything that met the clients needs - the the scripts ar eloaded into the public_html folder and admin is outside of the wordpress admin environment for now).

    I placed the following code in my header.php:<link type="text/css" rel="stylesheet" href="/cal/css/calendar.css" />
    <link type="text/css" rel="stylesheet" href="/cal/ajax.php?controller=calendars&action=css&cid=1" />
    <script type="text/javascript" src="/cal/js/custom.js"></script>
    <script type="text/javascript" src="/cal/js/front.js"></script>`

    Secondly, in a UI tab, and between the [tab] and [/tab], I placed this code to call the javascript :
    <script type="text/javascript" src="/cal/load.php?cid=1&view=1"></script>

    The calendar IS visable and seems to be working BUT it appears AFTER(under) the UI tab window. ie looks like the calendar js is only running AFTER the jquery UI tab. I have tried a number of ideas without success (javascript plugins for example) but the result is always the same - the calendar renders outside the ui tab area.

    Could someone please point me in the right direction - iwould be really grateful.

  2. Mark / t31os
    Moderator
    Posted 3 years ago #

    What's in the file called from this line?

    <script type="text/javascript" src="/cal/load.php?cid=1&view=1"></script>

    If i had to guess i'd say the script simply adds some elements to the DOM(the page) after load, and it's not necessarily just going to insert those elements where you call the script.

    Can you post a copy of that file in a pastebin and report the link back here please.

Topic Closed

This topic has been closed to new replies.

About this Topic