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
Ron McLeod
Paul Clapham
Devaka Cooray
Tim Cooke
Sheriffs:
Rob Spoor
Liutauras Vilda
paul wheaton
Saloon Keepers:
Tim Holloway
Tim Moores
Mikalai Zaikin
Carey Brown
Piet Souris
Bartenders:
Stephan van Hulst
Forum:
HTML Pages with CSS and JavaScript
Can someone help me with the "new" dojo calls?
chris gar
Ranch Hand
Posts: 45
posted 15 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 15 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.
Hey! You're stepping on my hand! Help me tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
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...