Jump to content

Jquery load - which assumes the "loader" page PHP content?


Recommended Posts

I have a PHP page which uses variables and stuff set at the top of the page.

 

When I load content into a div on my page, such as: $("#mydiv").load("loadedcontent.php");, I have to reset all those variables and put them inside loadedcontent.php as well, otherwise they dont exist.

 

Essentially, I'm aiming for a way to "reload" a section of content on a page without reloading the entire page, and only "updating" at section of content. When you do an AJAX load its treated as if it is a seperate script, since the parent script has already been executed - but I'm looking for a way to have it be a bit more intelligent if possible.

 

Hope you have some ideas!

Not sure what you are exactly asking, but would passing data to loadedcontent.php work? You can pass both GET and POST vars to the page you are loading with AJAX.

 

If that isn't what you are looking for, can you try explaining it a little more? Maybe an example?

Ok I'll try to explain then,

 

I could use GET or even global $myVar (potentially) so that loadedcontent.php obtains the variables from its loader page. However, I have other things I would need to "pass", such as the "PHP + CSS Dynamic Text Replacement (P+C DTR)" (it replaces text with png images so you can use any font) script I've implemented - the problem being that it won't work if I include it such as I have before - it requires css files which need to be "passed" to the loadedcontent.php as well.

 

The end result of what I'm trying to achieve is a method to submit a form, and add the submitted "comment" instantly to the comments div. However, for the comment to be added, I have text in there which utilizes the "PHP + CSS Dynamic Text Replacement (P+C DTR)" script and that script won't process with the loader... actually that's my entire problem, everything else I could just pass through with GET or REQUEST (with the jquery function, you can send variables: $("#mydiv").load("loadedcontent.php", {myVar: "heythere"}); --which translates to REQUEST['myVar']; on the loadedcontent.php page)

The first time the page is loaded the heading's CSS file is dissected and added to that browser session. This means that the extra hit from parsing the CSS file only occurs once per browser session.

the site says all the info should be in the session. so you shouldn't need the CSS file

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.