bipin Posted May 1, 2008 Share Posted May 1, 2008 i need to display the content from serverside page but using script tag i tried to do script tag as below <script src="test.php"> but it generates the dom error ony i can see the value while i view the source code of the page not in the web page so any help n suggestion is most welcomed Quote Link to comment https://forums.phpfreaks.com/topic/103684-getting-value-from-serverside-page-using-script-src/ Share on other sites More sharing options...
wrongmove18 Posted May 1, 2008 Share Posted May 1, 2008 what is the content from test.php? Quote Link to comment https://forums.phpfreaks.com/topic/103684-getting-value-from-serverside-page-using-script-src/#findComment-530883 Share on other sites More sharing options...
RichardRotterdam Posted May 1, 2008 Share Posted May 1, 2008 why not do this instead? <script> <?php echo("your javascript"); ?> </script> or <script> <?php include("test.php"); ?> </script> Quote Link to comment https://forums.phpfreaks.com/topic/103684-getting-value-from-serverside-page-using-script-src/#findComment-530958 Share on other sites More sharing options...
taith Posted May 1, 2008 Share Posted May 1, 2008 why not do this instead? <script> <?php echo("your javascript"); ?> </script> or <script> <?php include("test.php"); ?> </script> external files stay in the browser cache... so you dont need to redownload them for every load of the pages... its best to keep (most) js functions in an external, and only initiate it in the parent window as for having a php document acting as a js document... in your .htaccess... add in "AddType application/x-httpd-php .js" which'd tell the server to parse your <script src="file.php"> file before acting it as a js file Quote Link to comment https://forums.phpfreaks.com/topic/103684-getting-value-from-serverside-page-using-script-src/#findComment-531103 Share on other sites More sharing options...
bipin Posted May 1, 2008 Author Share Posted May 1, 2008 first of all thnx to helping actually i am makin to a rss reader which on base of given link (eg thefeedtool.com) now i have made all the codes except the one which generates the rss from the javascript method . so guys still waiting for Quote Link to comment https://forums.phpfreaks.com/topic/103684-getting-value-from-serverside-page-using-script-src/#findComment-531119 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.