javascript - How does document.write() influence the functionality of jQuery? -
in client uses jquery , jqxwidget jqxmenu (approx. 3 of 10 times) fails on 1 particular page 'enriched' appropriate css styles (in order make jqxmenu).
the included code fragments jqxmenu works on each other page of client. difference working pages failing page includes javascript server dynamically display options.
the remotely included code looks like:
document.write('<table cellspacing="2" cellspacing="2" border="0" align="center">'); document.write('<tr>'); document.write('<td><a href="http://www.someurl.com" target="_blank"><img src="https://someimage.com/jsp/icons/someimage.gif" border="0" ... document.write('</tr>'); document.write('</table>');
when embed generated table statically in code issue doesn't occur.
static variant fixes issue:
<table cellspacing="2" cellspacing="2" border="0" align="center"> <tr> <td><a href="http://www.someurl.com" target="_blank"><img src="https://someimage.com/jsp/icons/someimage.gif" border="0" ... </tr> </table>
the question is: there problem using document.write()
in conjunction jquery and/or jqwidgets?
what workaround (thinking of wrapper, since parsing , use jquery put them seems overkill)?
document.write
blocks execution of jquery code since jquery acts on elements in dom, while using document.write, these elements don't exist. jquery unable find dom elements.
Comments
Post a Comment