Recent Widgets


Register for DashboardWidgets

Recent Forums Posts

Partners


iCompositions

MacDesktops.net

RSS Showcase
RSS Comments
RSS Forums

This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. Posted in: Widget Development

need a sample of XMLHTTPRequest

Author Message
wiedo



Joined: 05 May 2005
Posts: 4

Posted: Thu May 05, 2005 - 5:11 pm    Post subject: need a sample of XMLHTTPRequest Reply with quote

Hi al.
I want to make a little widget that show's the last link posted at eyeballsex.com.

The only thing it has to do is to grab the last entry of www.eyeballsex.com/rss/eyeballsex.php

I already made the design. But i can get the XMLHTTPRequest work.

Can somebody help me with this?
View user's profile Send private message Send e-mail Visit poster's website Widgets
avnit



Joined: 25 Apr 2005
Posts: 23

Posted: Thu May 05, 2005 - 8:08 pm    Post subject: Reply with quote

Code:

req = new XMLHttpRequest()
url = "http://www.google.com"
req.open("GET", url ,false)
req.send(null)
content = req.responseText


Will grab google.com and put it in the variable content.
View user's profile Send private message Send e-mail Visit poster's website Widgets
wiedo



Joined: 05 May 2005
Posts: 4

Posted: Fri May 06, 2005 - 4:06 am    Post subject: Reply with quote

thnx..

so this has to go between <script></script>?
and how can i echo content?

sorry i'm a total n00b in javascript. It's a pitty you can't PHP in a widget Smile
View user's profile Send private message Send e-mail Visit poster's website Widgets
wiedo



Joined: 05 May 2005
Posts: 4

Posted: Fri May 06, 2005 - 4:38 am    Post subject: Reply with quote

now made the link:
http://www.eyeballsex.com/rss/widget.php


and this code:
Code:

<span onclick="widget.openURL('
        $content
        </span>


the only thing i have to do is to print the content of widget.php on the place of $content..

How does this work?

Code:

<script type="text/javascript">
req = new XMLHttpRequest()
url = "http://www.eyeballsex.com/rss/widget.php"
req.open("GET", url ,false)
req.send(null)
content = req.responseText
</script>


is this right?
and how to print the content on the right place?
View user's profile Send private message Send e-mail Visit poster's website Widgets
wiedo



Joined: 05 May 2005
Posts: 4

Posted: Fri May 06, 2005 - 10:01 am    Post subject: Reply with quote

ok thnx all..
ive got it working...
now to fix up the some final bugs.
View user's profile Send private message Send e-mail Visit poster's website Widgets
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.

 
Powered by phpBB © 2001, 2002 phpBB Group