Friday, October 1, 2010

JQuery ajax can't find elements in returned HTML

Programmer Question

I have a simple



$.ajax({
url: someUrl,
method: 'get',
dataType: 'html',
success: function(data) {
$('#someId').append($(data));
}
});


The problem is I can't find elements simply within the returned data. If there's an input with id="myInput" I can't get it with $('#myInput') or $('input[id=myInput]'). I CAN find it with:



$('input').each(function(i,e){ if($(e).attr('id') == 'myInput'){ doStuff(e); } });


But who wants to do that each time? I saw this question but the solutions provided didn't work for me. In addition to what's up there I've tried



$('#someId').html(data);
$(data).appendTo($('#someId'));


and I'm using jQuery 1.4.2. Thoughts, suggestions?



Find the answer here

adding on ?v=1 to urls

Programmer Question

As seen in the code from http://html5boilerplate.com/ (ctrl+f "?v=1")
What does ?v=1 do exactly? It's tacked on to the external css and js urls.



Find the answer here

Thursday, September 30, 2010

XML to XLS using java

Programmer Question

How can I map the metadata to data. For example I only want LastName and Email from the xml file into the xls file. How can I select LastName and email from xml file and convert that into two column XLS file columns being Lastname and email. Thank you



XML Document















XXX
xxxx
xxx
xxx
xxx
xx
xx


xxy
xx
xx
xx
xx
xx
xx





Find the answer here

LinkWithin

Related Posts with Thumbnails