Updating a web widget

sthaznpride17

Senior member
Jul 31, 2005
252
0
0
I am writing a web widget that functions as a salary calculator based on the user input such as degree and field of interest. I need a way to get information from a database and update the widgets contents using that information. The widget is written in HTML/Javascript. The way I understand it, I cannot use Ajax due to the nature of a widget.
 

nickbits

Diamond Member
Mar 10, 2008
4,122
1
81
You have 3 options:
1. Use AJAX
2. Preload all data into the page
3. Trigger page refresh on the drop down selections

Since you said AJAX isn't an option, I'd probably go for option 2 if there isn't too much data.
 

blahblah99

Platinum Member
Oct 10, 2000
2,689
0
0
Originally posted by: sthaznpride17
I am writing a web widget that functions as a salary calculator based on the user input such as degree and field of interest. I need a way to get information from a database and update the widgets contents using that information. The widget is written in HTML/Javascript. The way I understand it, I cannot use Ajax due to the nature of a widget.

Unless the widget uses a plugin, I don't see why data couldn't be AJAX'd. If the widget IS using a plugin, there'd better be substantial reasons for using a plugin instead of standard form elements.

If you must use a non-ajax method, I would use a page refresh via onchange on the dropdown box.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
Originally posted by: blahblah99
Originally posted by: sthaznpride17
I am writing a web widget that functions as a salary calculator based on the user input such as degree and field of interest. I need a way to get information from a database and update the widgets contents using that information. The widget is written in HTML/Javascript. The way I understand it, I cannot use Ajax due to the nature of a widget.

Unless the widget uses a plugin, I don't see why data couldn't be AJAX'd. If the widget IS using a plugin, there'd better be substantial reasons for using a plugin instead of standard form elements.

If you must use a non-ajax method, I would use a page refresh via onchange on the dropdown box.

It's funny, because I'd say the nature of a widget is to use AJAX.
 

sthaznpride17

Senior member
Jul 31, 2005
252
0
0
I ended up using Ajax with Prototype, but now I have another problem. I originally wrote the web service that outputs the information to the widget in PHP, but I found out that the service needs to use ASP.net. Can I just write a ASP.net web service and change the Ajax url to the .asxm file or do I need to rethink the implementation?