Parsing and selecting from HTML string

Using an ajax call I have returned the partialView HTML of a page, but before I display it I wish to pull information from the main div. This data is just size information, for if I create a floating window.


<div class="window-details" data-height="500px" data-width="500px">more data here</div>

this.PopUp = function (url, title) {
  .success(function (partialViewHtml) {
     var partialViewDom = $(partialViewHtml);
     var thisDiv = $(".window-details", partialViewDom);

I can see the data in chromes debugger when hovering over partialViewDom, but the class selection does not appear to have worked. Any clues? Does it not parse correctly? Thanks.


Try using the .filter() instead, most likely your .window-details element is a top level element in the dom fragment.

var thisDiv = partialViewDom.filter(".window-details");

Need Your Help

How to make class iterable?

python object iterator

How would one create an iterable function or class in Python?

Support for Hadoop 1.0.1 jobs on Amazon EMR

hadoop emr

I have developed some MR jobs using java and hadoop 1.0.1. However, EMR supports only upto Hadoop 0.20. Is it possible to run Hadoop 1.0.1 jobs on EMR or do I have to downgrade my library stack to ...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.