- Screen name: Opolo Webdesign
Opolo Webdesign's Profile
6 Posts
12 Responses
0
Followers
Show:
- Expanded view
- List view
Private Message
I have an XML that looks like this:
<?xml version="1.0" encoding="utf-8"?> <export> <Article URL="test"> <DisplayName>test</DisplayName> <Summary>test</Summary> <ThumbNail ID="test" URL="test" /> </Article> </export>
Which I'm looking to parse using jQuery. This works using the following code:
$.ajax({ url: 'https://[fqdn]/[filename].xml' }) .done(function(xml) { $(xml).find('Article').each(function() { console.log($(this).attr('URL')); console.log($(this).find('DisplayName').text()); console.log($(this).find('Summary').text()); console.log($(this).find('ThumbNail').attr('URL')); }); }) .fail(function(jqXHR, textStatus) { console.log(textStatus); })
All output is logged to the console, but at the end I'm getting an error saying the XML is malformed at line 1 column 78 which is causing my entire script to halt.
Is this the right way to go about this?
Adding dataType: "xml", and/or type: "GET", does not help.I have been using jQuery Mobile for a few years now for building apps based on Phonegap Build. Since iOS 10 it seems regular linking to sub pages results in "error loading page". What I do is very simpel:
index.html => a jQuery call loads the jQuery Mobile listview with:
<a href="item.html?id=1">
Next I have that file (item.html) which is linked to in the same directory, so the file does exist.
What could this be and why did it stop working? On Android is works fine btw. I have "cordova-plugin-whitelist" included in my project with the following option:
<allow-navigation href="*" />
Anyone that has had this problem and was able to solve it?
- 06-Nov-2015 08:35 AM
- Forum: jQuery Mobile
I'm building an app that gets data from a server using basic user authentication. This works fine on Android, but on iOS nothing happens. In safari it also works fine.
This is the code I'm using:
$.ajax({
url: main_url+'api-cache/'+slug+'.json?r='+random_number(),
dataType: 'json',
headers: {
'Authorization': "Basic " + btoa(localStorage.getItem('email') + ":" + localStorage.getItem('password'))
}
})
.done(function(result) {
main_url is a link to an https website.
I have als tried username and passwork like the jQuery documentation says and also beforesend, nothing seems to work. Without the authentication it works fine by the way. Also the result seems to be ".done" because no error is fired in ".fail".
Help? Oh and btw, I'm using Phonegap Build.- I use the following html to show a fixed header:
- <div data-role="header" data-position="fixed" data-tap-toggle="false">
- <h1>Title</h1>
- </div>
When scrolling through a listview, clicking a link from that listview and thus going to another page (a real page not a hidden div on the index file) and returning to the listview via a data-rel=back, the header shortly disappears/flickers. Can this be fixed?- Did jQuery Mobile already fixed the iOS "bug" of the fixed header? When working on Android (in combination with Phonegap by the way) the fixed header stays fixed when focusing on an input field, but when doing this on iOS the header starts scrolling. Is this a jQuery Mobile flaw or an iOS feature?
I have found numerous ways of hiding the header onfocus, but I would simply like the header to stay at the top of the page/app. Can this be done?- I'm trying to build an Android app using jQuery mobile and Phonegap. So far it's going quite smoothly. I want to create a form with a number of checkboxes, for this I'm loading a json file from an external location and with "each" I'm filling a variable which I append to an item. When doing this the stylesheet completely disappears. When using plain html the stylesheet is shown perfectly. So I was wondering how to deal with this issue.
This is a snippet of my code (javascript):- //test
var test = function() {
$.ajax({
url: 'http://url/android.json',
dataType: 'json',
data: '',
success: function(result) {
data = eval(result);
var options = '';
$.each(data, function(name,hash){
options += '<input type="checkbox" name="checkbox-' + hash + '" id="checkbox-' + hash + '" value="' + hash + '" class="custom" />';
options += '<label for="checkbox-' + hash + '">' + name + '</label>';
});
$('#test').append(options);
}
});
return false;
};
test();
This is the content of my body tag:- <div data-role="page" class="type-interior">
<div data-role="content">
<div class="content-primary">
<form action="#" method="get">
<h2>Form elements</h2>
<fieldset data-role="controlgroup" id="test">
</fieldset>
</form>
</div>
</div>
</div>
All checkboxes are shown, but without stylesheet. It should look something like this:
http://jquerymobile.com/demos/1.0b1/#/demos/1.0b1/docs/forms/forms-checkboxes.html (vertically grouped checkboxes)
Hope you guys can help me on my quest for my first app ;-)
This is how it looks now:- «Prev
- Next »
- //test
Moderate user : Opolo Webdesign
© 2013 jQuery Foundation
Sponsored by and others.

