In my web site I’ve multiple calls of the jquery function load().
We can sumarize like this :
1) In My index page calls this $('#mainFrame').load('/antoherPage.jsp');
I insert this code in the head of my index page :
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dijit/themes/claro/claro.css"/><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js" djConfig="parseOnLoad: true,locale: 'en'"></scipt>
2) In my another page, it calls this $('#main').load('/Form.jsp');
3) In ‘Form’, I’ve some field from dijit : dijit.form.ValidationTextBox, …
<input dojoType='dijit.form.ValidationTextBox'></input>
In my index page, I’ve this :
Basically, if I load the page Form.jsp, everyhting is correctly displayed. However, when I load my index page, everyhting is not correctly diplayed in the Form.
I’d like to know if I need to write some special code into the form page or into another page. Maybe the multiple calls of the load is not accepted by dojo/dijit?
Thank you very much
Bat
After you ajax load a page, you need to call
dojo.parser.parse(). Dojo has no idea that you are loading another page via ajax, and thus the parser doesn’t know to look through the new content for dijit widgets in markup.You’ll need to
dojo.require('dojo.parser')as well.EDIT: looking at the jquery load docs, a more full featured example would be:
As always, the dojo.parser component should be loaded prior to the execution of that ajax call