NeoMarine Posted November 20, 2008 Share Posted November 20, 2008 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! Quote Link to comment https://forums.phpfreaks.com/topic/133462-jquery-load-which-assumes-the-loader-page-php-content/ Share on other sites More sharing options...
rhodesa Posted November 20, 2008 Share Posted November 20, 2008 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? Quote Link to comment https://forums.phpfreaks.com/topic/133462-jquery-load-which-assumes-the-loader-page-php-content/#findComment-694312 Share on other sites More sharing options...
NeoMarine Posted November 20, 2008 Author Share Posted November 20, 2008 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) Quote Link to comment https://forums.phpfreaks.com/topic/133462-jquery-load-which-assumes-the-loader-page-php-content/#findComment-694480 Share on other sites More sharing options...
rhodesa Posted November 20, 2008 Share Posted November 20, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/133462-jquery-load-which-assumes-the-loader-page-php-content/#findComment-694496 Share on other sites More sharing options...
NeoMarine Posted November 20, 2008 Author Share Posted November 20, 2008 Thank you for that. I will look into this further! Quote Link to comment https://forums.phpfreaks.com/topic/133462-jquery-load-which-assumes-the-loader-page-php-content/#findComment-694596 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.