Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Referencing a php file through external javascript? Need help formatting
Old 05-31-2008, 11:50 PM Referencing a php file through external javascript? Need help formatting
dwmeso's Avatar
Skilled Talker

Posts: 83
Name: DWMeso
Trades: 2
I don't know much about javascript, so I'm not exactly sure how everything should be formated to do this.. but I know you can reference a php file rather than a .js file as long as it gives the javascript header and uses document.write to display the php..





Nevermind, got it working.

Last edited by dwmeso; 06-01-2008 at 08:03 PM..
dwmeso is offline
Reply With Quote
View Public Profile Visit dwmeso's homepage!
 
 
Register now for full access!
Old 06-01-2008, 12:00 PM Re: Referencing a php file through external javascript? Need help formatting
upstarter's Avatar
Average Talker

Posts: 26
Name: Starr Horne
Trades: 0
Sure, you can use whatever extension you like when including a JS file.

However, it doesn't look like your php file actually outputs any javascript. When you include a JS file, that file has to contain JS and only JS.

Now that JS can be output by a php file. You can even do fancy tricks to construct the JS server-side. But everything that's returned to the browser needs to be script, not html.

Perhaps you're wanting a php include instead?
__________________
my company:
Please login or register to view this content. Registration is FREE


my blog:
Please login or register to view this content. Registration is FREE
upstarter is offline
Reply With Quote
View Public Profile Visit upstarter's homepage!
 
Old 06-01-2008, 04:10 PM Re: Referencing a php file through external javascript? Need help formatting
dwmeso's Avatar
Skilled Talker

Posts: 83
Name: DWMeso
Trades: 2
Nope, not wanting a php include. I need it to be in the form of a javascript just so people can use it on their pages without it having to be a php page.

Last edited by dwmeso; 06-01-2008 at 08:04 PM..
dwmeso is offline
Reply With Quote
View Public Profile Visit dwmeso's homepage!
 
Old 06-01-2008, 05:10 PM Re: Referencing a php file through external javascript? Need help formatting
dwmeso's Avatar
Skilled Talker

Posts: 83
Name: DWMeso
Trades: 2
Got it working.

Last edited by dwmeso; 06-01-2008 at 08:04 PM..
dwmeso is offline
Reply With Quote
View Public Profile Visit dwmeso's homepage!
 
Reply     « Reply to Referencing a php file through external javascript? Need help formatting
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12780 seconds with 12 queries