Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within HTML Pages with CSS and JavaScript
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
HTML Pages with CSS and JavaScript
Can someone help me with the "new" dojo calls?
chris gar
Ranch Hand
Posts: 45
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I've evidently found the "old" way of doing things with dojo. I'm getting errors at dojo.io.bind. Firebug says it cant find it. I think I've downloaded the new toolkit but am using old code.
Can anyone point me in the right direction?
dojo.require("dojo.io.*"); dojo.require("dojo.event.*"); function onchange_method() { var params = new Array(); params['attributeId'] = document.getElementById(att1.id).value; alert('a'+document.getElementById(att1.id).value); var bindArgs = { url: "Ajax_operators.action", error: function(type, data, evt){ //alert("error"); }, mimetype: "text/json", content: params }; var req = dojo.io.bind(bindArgs); dojo.event.connect(req, "load", this, "populateVendorName"); } function populateVendorName(type, data, evt) { if (data.vendorName != null) { alert('you got'+data.operators[0][0]); // document.getElementById("op1").value = data.vendorName; } }
chris gar
Ranch Hand
Posts: 45
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Never mind - I figured it out.
<script type="text/javascript" src="http://o.aolcdn.com/dojo/1.3.1/dojo/dojo.xd.js"></script> <script language="javascript" > dojo.require("dojo.io.script.js"); function onchange_vendornbr() { alert('in your method'); dojo.xhrGet( { // // The following URL must match that used to test the server. url: "../json/Ajax_operators.action?attributeId=22", handleAs: "text", timeout: 5000, // Time in milliseconds // The LOAD function will be called on a successful response. load: function(response, ioArgs) { // dojo.byId("cargo").innerHTML = response; // return response; // }, // The ERROR function will be called in an error case. error: function(response, ioArgs) { // console.error("HTTP status code: ", ioArgs.xhr.status); // return response; // } }); } </script>
Make sure you have the right version (for
struts
) of the json plugin.
Surfs up space ponies, I'm making gravy without this lumpy, tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Reading a 'Collection' object from JSON
Writing JSON data back to client
Dojo populatig drop down before request comes from the server
dojo and javascript DOM issue
Problem with dojo.io.bind
More...