Loading...
Copy code
Close
Permalink
Close
Please tell us why you want to mark the subject as inappropriate.
(Maximum 200 characters)
Report Inappropriate
Cancel
Private Message
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Cancel
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Update
Cancel
Feedback
Email ID
Subject :
Comments :
Send
Cancel
Private Message
Type the characters you see in the picture below.
Type the characters you see in the picture below.
Attach files
Desktop
Google Docs
Each Attachment size should not exceed 1.0 MB.
Max no of attachments : 3
Loading User Profile...
guest
Response title
This is preview!
Attachments
Publish
Back to edit
Cancel
(
)
Sign In
New to this Portal? Click here to
Sign up
You can also use the below options to login
Login with Facebook
Login with Google
Login with Yahoo
jQuery
Plugins
UI
Meetups
Forum
Blog
About
Donate
All Forums
Recent Posts
Log In
Search
jQuery
Search
jQuery Forum
Screen name:
zianchoy
zianchoy's Profile
3
Posts
1
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Ideas
Problems
Expanded view
List view
Private Message
Vanishing Post
[2Replies]
28-Oct-2010 10:48 PM
Forum:
About the jQuery Forum
On the 24th, I made a post in the Getting Started forum. Today, when I checked in on the thread, I noticed that my question no longer exists. Instead, when I go to
http://forum.jquery.com/topic/jquery-xml-parser-with-a-validated-xml-file
, I get the following response:
Requested URL not found!
jQuery XML Parser With A Validated XML File
[0Replies]
24-Oct-2010 06:05 PM
Forum:
Getting Started
I am getting a parsererror when I try to use $.ajax to obtain an XML file.
Code to repro:
<head>
<title>Slightly Chilly</title>
<script type="text/javascript" src="js/jquery-1.4.3.js"></script>
<script type="text/javascript" src="js/jquery.jsonp-2.1.2.js"></script>
</head>
<body>
<script type="text/javascript">
$(document).ready(function () {
$("#SubmitForm").bind("click", GetLocalWeatherStations);
});
function ProxifyURL(desiredURL)
{
var result = "
http://localhost/Slightly
Chilly/proxy.php?url=";
result += encodeURIComponent(desiredURL);
return result;
}
function GetLocalWeatherStations()
{
var latitude=34.26100159;
var longitude=-118.28700256;
$.ajax({
url: ProxifyURL("
http://api.wunderground.com/auto/wui/geo/GeoLookupXML/index.xml?query
=" + encodeURIComponent(latitude + "," + longitude)),
dataType: "xml",
type: "GET",
success: function(xml, message){
var airportLatitude, airportLongitude, airportID;
var pwsLatitude, pwsLongitude, pwsID;
$(xml).find('airport:first').each(function (){
$(this).find('station:first').each(function (){
airportLatitude=$(this).find('lat:first').text();
airportLongitude=$(this).find('lon:first').text();
airportID=$(this).find('icao:first').text();
});
});
$(xml).find('pws:first').each(function (){
$(this).find('station:first').each(function (){
pwsLatitude=$(this).find('lat:first').text();
pwsLongitude=$(this).find('lon:first').text();
pwsID=$(this).find('id:first').text();
});
});
if (airportID == undefined && pwsID == undefined)
{
alert("Uh oh.");
}
else if(airportID == undefined)
{
GetPWSHistoricalTemperatures(pwsID, pwsLatitude, pwsLongitude);
}
else
{
GetAirportHistoricalTemperatures(airportID,airportLatitude, airportLongitude);
}
},
error: function(blob, anotherBlob){
alert("Woe is me! getLocalWeatherStations");
}
});
// "ProxyPage.aspx&u=" + encodeURIComponent("
http://www.wunderground.com/history/airport/KSFO/2008/1/15/DailyHistory.html?format=1
"));
}
</script>
...more HTML...
<a id="SubmitForm" href="#">Get Temperature Information</a></p>
...more HTML...
</body>
</html>
To confirm that the XML file is valid, I requested
http://api.wunderground.com/auto/wui/geo/GeoLookupXML/index.xml?query=32.71568521857262,-117.16172486543655
using Fiddler, saved the Request Body as an XML file, and validated it.
I noticed that there are some tabs in the file outside the tags. For an example, take a peek at the end of the XML document.
Is this a bug in jQuery or is it something I messed up?
jQuery XML Parser With A Validated XML File
[1Reply]
24-Oct-2010 06:05 PM
Forum:
Getting Started
I am getting a parsererror when I try to use $.ajax to obtain an XML file.
Code to repro:
<head>
<title>Slightly Chilly</title>
<script type="text/javascript" src="js/jquery-1.4.3.js"></script>
<script type="text/javascript" src="js/jquery.jsonp-2.1.2.js"></script>
</head>
<body>
<script type="text/javascript">
$(document).ready(function () {
$("#SubmitForm").bind("click", GetLocalWeatherStations);
});
function ProxifyURL(desiredURL)
{
var result = "
http://localhost/Slightly
Chilly/proxy.php?url=";
result += encodeURIComponent(desiredURL);
return result;
}
function GetLocalWeatherStations()
{
var latitude=34.26100159;
var longitude=-118.28700256;
$.ajax({
url: ProxifyURL("
http://api.wunderground.com/auto/wui/geo/GeoLookupXML/index.xml?query
=" + encodeURIComponent(latitude + "," + longitude)),
dataType: "xml",
type: "GET",
success: function(xml, message){
var airportLatitude, airportLongitude, airportID;
var pwsLatitude, pwsLongitude, pwsID;
$(xml).find('airport:first').each(function (){
$(this).find('station:first').each(function (){
airportLatitude=$(this).find('lat:first').text();
airportLongitude=$(this).find('lon:first').text();
airportID=$(this).find('icao:first').text();
});
});
$(xml).find('pws:first').each(function (){
$(this).find('station:first').each(function (){
pwsLatitude=$(this).find('lat:first').text();
pwsLongitude=$(this).find('lon:first').text();
pwsID=$(this).find('id:first').text();
});
});
if (airportID == undefined && pwsID == undefined)
{
alert("Uh oh.");
}
else if(airportID == undefined)
{
GetPWSHistoricalTemperatures(pwsID, pwsLatitude, pwsLongitude);
}
else
{
GetAirportHistoricalTemperatures(airportID,airportLatitude, airportLongitude);
}
},
error: function(blob, anotherBlob){
alert("Woe is me! getLocalWeatherStations");
}
});
// "ProxyPage.aspx&u=" + encodeURIComponent("
http://www.wunderground.com/history/airport/KSFO/2008/1/15/DailyHistory.html?format=1
"));
}
</script>
...more HTML...
<a id="SubmitForm" href="#">Get Temperature Information</a></p>
...more HTML...
</body>
</html>
To confirm that the XML file is valid, I requested
http://api.wunderground.com/auto/wui/geo/GeoLookupXML/index.xml?query=32.71568521857262,-117.16172486543655
using Fiddler, saved the Request Body as an XML file, and validated it.
I noticed that there are some tabs in the file outside the tags. For an example, take a peek at the end of the XML document.
Is this a bug in jQuery or is it something I messed up?
«Prev
Next »
Moderate user : zianchoy
Forum