I have been working on some simple JQuery based ajax loading of content (well i thought it would be simple), and have hit an issue where as once it is re-loaded the page content i do not the new contents style does not match the original.
I have the following:
the modx Content Management Framework
Jquery 1.3.2
A Text Resizer Module for Jquery
Some custom code to load my pages based upon Link Clicked and Context of the link
A Set of pages to be loaded which are identical to the pages being loaded with the exception of content (Navigation, Style, Footer are all identical) to save for JS Loading Errors
To load the content from the new page into the current Div, where "contentPath" is the path to the new page.
When the page loads it checks to see if a cookie has been set and if so will also load content based upon the page.
Now when you view the page before content has been loaded you see a perfectly styled page (well perfect in relevance to the site). When you view the page i am trying to load content from the you get a perfectly styled page. But when Jquery does the content load the styling is lost, especially when it comes to tables and line breaks.
Now the only styling that is applied to the pages dynamically is for alternative table rows (which is done in $(document).ready) and seems to apply.
Question
SanityNTXistant
Hello....
I have been working on some simple JQuery based ajax loading of content (well i thought it would be simple), and have hit an issue where as once it is re-loaded the page content i do not the new contents style does not match the original.
I have the following:
I am using:
$("#contentLeft").load( contentPath + " #contentLeft *");To load the content from the new page into the current Div, where "contentPath" is the path to the new page.
When the page loads it checks to see if a cookie has been set and if so will also load content based upon the page.
Now when you view the page before content has been loaded you see a perfectly styled page (well perfect in relevance to the site). When you view the page i am trying to load content from the you get a perfectly styled page. But when Jquery does the content load the styling is lost, especially when it comes to tables and line breaks.
Now the only styling that is applied to the pages dynamically is for alternative table rows (which is done in $(document).ready) and seems to apply.
Any Ideas?
Al
Link to comment
Share on other sites
4 answers to this question
Recommended Posts