jQuery ajax call incorrectly nesting php generated html -


i'm using jquery hijack link pointing php file. php file html, calls 2 php functions each use loop output html. problem i'm running ajax call incorrectly nesting html generated php loop.

including php file directly onto page works fine, when trying grab via ajax html content of each sequential pass through loop inserted inside generated html. example:

<div>content1</div> <div>content2</div> <div>content3</div> 

becomes:

<div>content1<div>content2<div>content3</div></div></div> 

this relevant code php file:

<div class="publishedposts">   <h3>published</h3>   <?php displaypublishedblogposts(); ?> </div> <div class="verticaldivider"></div> <div class="draftposts">   <h3>saved drafts</h3>   <?php displayblogpostdrafts(); ?> </div> 

and jquery code:

function adminpaneltabs() {   $('#adminpaneltabs ul li a').click(function(e) {     $('#adminpaneltabs ul li a.current').removeclass('current');     $(this).addclass('current');     $('#adminpanelcontent').load($(this).attr('href'));     e.preventdefault();   }); } 

would appreciate input or suggestions on how fix this.

alt text

go figure - spend hours researching how fix this, post here last resort, figure out problem 30 minutes later.

for record, problem in php functions being called. included sections closing div tag enclosed in if statement.

the if statement checked see if user logged in, , though true apparently making ajax call in way fails such if statement, hence closing div tag never added.

i'd thank nick responding, helped trigger idea problem might be.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -