0

I'm facing the following problem: I'm using jQuery to display an inline pop-up when trying to press a link on a page. The inline popup is defined inside a .jspf page as follows:

<div id="x" style="display:none">
    <a id="y" class="thickbox" href="#TB_inline?height=150&width=400&inlineId=w&modal=true">Show hidden modal content.</a>
</div>

<div id="w" style="display: none;">
...
</div>

I am using onclick="checkLogout(); return false;" where

function checkLogout(){
    document.getElementById("y").click();
}

to display the inline content.

The jspf file containing this content is used in multiple jsp files but when clicking the link, only the first page in a succession of ones using the jspf shows the content and behaves normally. The others call the checkLogout() function but don't show the inline content.

Does anyone have a clue what I'm doing wrong?

Thanks in advance!

Rasabihari Kumar
  • 491
  • 1
  • 4
  • 16
Man M
  • 39
  • 6
  • I just updated your code in which `
    ` was written as `` thinking it was a typo for the question. But could this be the cause of your issue. Please check.
    – Rasabihari Kumar Nov 06 '12 at 10:51
  • nope, the original code has
    , i just misspelled it here. sorry and thanks.
    – Man M Nov 06 '12 at 11:17

1 Answers1

0

I figured out the problem, it seemed that the java-script sources from the jsp page were not included in the correct order.

The jquery.js file needs to be the first js file and only after can you user other .js files.

eg.

<script type="text/javascript" src="jquery-1.4.4.min.js" />
<script type="text/javascript" src="otherJavaScriptFile.js" />
Man M
  • 39
  • 6