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.

Coding Forum


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



Reply
Server side Javascript?
Old 09-08-2003, 10:41 AM Server side Javascript?
Super Talker

Posts: 108
Trades: 0
Is there a way to load javascript at the server first before displaying the content to the user?

The reason is that there are a lot of info feeds I will be incorporating into my website, and I want all users to be able to see the content (even if their js is disabled) as well as Google being able to spider the content.

I was wondering if their is a PHP routine that could accomplish this...
SagaLore is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-08-2003, 12:00 PM
david's Avatar
King Spam Talker

Posts: 1,314
Location: Glasgow, UK
Trades: 0
I'm not sure if PHP could do this, as you'll need something to parse the Javascript. One way you could do it would be (if you have shell access) to write a little script to wget (i think thats the command) the JavaScript URL and store the output locally, then include that using PHP. You could set up a cron job to update it regularly.

Probably the best solution, though, would be to use an XML feed (if available) and parsing this with PHP. It's far more flexible and it will appear as if part of your site to the end users.
__________________

Please login or register to view this content. Registration is FREE
- Everything a webmaster needs - for free

Please login or register to view this content. Registration is FREE
- Free web hosts reviewed and rated

Please login or register to view this content. Registration is FREE
- Impartial hosting directory - Add your host today for FREE
david is offline
Reply With Quote
View Public Profile
 
Old 09-08-2003, 12:14 PM
Super Talker

Posts: 108
Trades: 0
I would like to use XML but the majority of the feeds are all javascript.

I was doing some searching and found that there is some type of Netscape server that will do server-side javascript but other than that, haven't found a solution.

I was hoping PHP had some type of pre-load command... but I guess the browser decodes the Javascript which means the server would need a way to decode it on it's end...

I suppose what I could do, is have a private page with the javascript, and then leave a browser open with a php script that refreshed the page periodically and then copied the content into a static file... but I would need a dedicated machine on a dedicated connection that could automatically send the update back up to my host.

Unless...

I had a script that used displayed the javascript rendered content for the first visitor of the day, but then quickly grabbed that content and stored into a file and each visitor at that point would get the static content...
__________________

Please login or register to view this content. Registration is FREE
SagaLore is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Server side Javascript?
 

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.11625 seconds with 12 queries