Current location: Hot Scripts Forums » General Web Coding » JavaScript » updating news


updating news

Reply
  #1 (permalink)  
Old 12-23-09, 06:46 AM
hemi hemi is offline
Wannabe Coder
 
Join Date: Aug 2009
Posts: 117
Thanks: 15
Thanked 0 Times in 0 Posts
updating news

hi

can we get news from any news site (ex: google news) wht i mean to say is , by JS code i should be able to get tht news to my web page and updates should also be happened. can we do this using javascript
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 12-23-09, 07:33 AM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
You cannot do this with Javascript alone; you'll need some sort of server-side script to retrieve the content.

Quote:
Originally Posted by hemi View Post
can we get news from any news site (ex: google news) wht i mean to say is , by <acronym title="JavaScript">JS</acronym> code i should be able to get tht news to my web page and updates should also be happened. can we do this using javascript
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 12-23-09, 08:16 AM
TwoD TwoD is offline
Community VIP
 
Join Date: Sep 2003
Location: 404
Posts: 1,813
Thanks: 0
Thanked 0 Times in 0 Posts
It's possible and easiest to do if the news site provides RSS feeds as they are much easier to parse than HTML.
If xmlHttpRequest (aka AJAX) was used, you would probably get browser security warnings because your site is running scripts which try to load data from other sites (domains). There are ways to get around this using other techniques but you are probably better off using PHP for this. Then your news aggregation would still work if the user has turned off JavaScript, and you get better control of how and when the news is aggregated, caching etc.

I've been working a lot with the CMS/Drupal lately, there is an optional core module (Aggregator) which does all this for you and there are contributed modules which do the same thing but also allow these aggregations to be automatically 'transformed' into other data forms such as content nodes (ie pages on your site).
__________________
[W3Schools - learn all about the standards.] [QuirksMode - Browser Quirks] [MS's Online Reference Docs] [DOM in Gecko.]
Please pay attention to stickys, announcements and forum rules, thank you.
Please also remember Code Wrappers and [SOLVED] Marking, this helps everyone.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
News publish php script help hyjlmc Script Requests 2 04-06-09 11:23 AM
tab separated news content shout it CSS 1 10-12-08 04:29 PM
"simple" News system Alex.css Script Requests 2 12-29-07 11:05 PM


All times are GMT -5. The time now is 02:59 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.