Can't make jparse to work properly.
Hi there!
I can't make the content of the xml-file to show. Callback & precallback functions work so it seems like the xml-file is loaded correctly. But the content doesn't show. I'm just not sure what I'm doing wrong here...
I've removed som tags in the html-code. I hope that someone has some experience working with this plugin and can help me out.
Below is the xml-file-content & the js-code below that.
Best, Niklas
XML-file
- <?xml version='1.0' encoding='utf-8'?>
- <text>
- <test><![CDATA[<p>testing</p>]]></test>
- </text>
JS-code
- <script type="text/javascript">
- // DOM is ready
- $(document).ready (function()
- {
- function start()
- {
- jQuery('#testcont').html('<img alt="Content Loading" src="images/ajax-loader.gif" />');
- }
-
- function finished()
- {
- alert("Hello World!");
- jQuery('#testcont').remove();
- };
-
- // load xml-file for home
- $('#ajax-cont').jParse
- ({
- precallback: start,
- ajaxOpts: {url: 'entre.xml'},
- callback: finished,
- elementTag: ['test'],
- output: '<p>jpet00</p>'
-
- });
- });
- </script>
- <title>Test</title>
- </head>
- <body>
- <div id="testcont"></div>
- <div id="ajax-cont"></div>
- </body>
- </html>