Hi. I am developing an android application at the moment, and i'm facing a problem that i have no idea how to solve. My application communicates with a Tomcat Server, and i'm using ObjectOutputStream to send a Document object to my application from my servlet. There fore, i'm importing org.w3c.dom to my project. The problem i'm facing is...
I'm trying to display dynamically changeable data manipulating with DOM elements (adding/removing them). I found out a very strange behavior of almost all browsers: after I removed a DOM element and then add a new one the browser is not freeing the memory taken by the removed DOM item. See the code below to understand what I mean. After ...
I am using some library: org.dom4j. I am beginer in JAVA. I want to know how get all childs in Node Books (i have sections, author in other info (not the some in all books node))
java.util.List BookList = xmlDocument.selectNodes("/BooksList/Books");
Iterator Biterator = BookList .iterator();
while(Biterator.hasNext()){
Element book...
I have the following code in a view controller. "pageDisplay" is a UIWebView.
When I run the app in simulator, the HTML page comes up as it appears before the JS runs. The element with id "myHeader", an <h1> tag, is unchanged.
-(void) loadPageToView:(int)pageNumber{
NSString *path = [[NSBundle mainBundle] pathForResource:[NSString s...
Hello!
I'm using DOM's loadHTMLFile to grab a page from elsewhere.
I need to find all hyperlinks on the page and then append them so they begin with another, fixed address. E.G.:
Take:
<a href="http://www.google.com"> Google yay! </a>
And turn it into:
<a href="http://cheese.com/http://www.google.com"> Google yay! </a>
Uns...
Ok, here goes a newbie question:
//function removes characters and spaces that are not numeric.
// time = "2010/09/20 16:37:32.37"
function unformatTime(time)
{
var temp = "xxxxxxxxxxxxxxxx";
temp[0] = time[0];
temp[1] = time[1];
temp[2] = time[2];
temp[3] = time[3];
temp[4] = time[5];
temp[5] = ...
I am trying to get the text from within a tag - but that tag has a nested node, too which I don't want. How do I just get the text?
For example
<div id="i_want_the_text_in_this_div">
<span id="but_not_this_one">
ignore this text
</span>
keep this text
</div>
...
I am trying to inject an external html file into the current DOM using javascript. This is on the same domain so Single Origin Policy is not an issue.
var body = document.getElementsByTagName('body')[0];
var script= document.createElement('p');
script.innerHTML = 'http://samedomain.com/my.html';
body.appendChild(script);
any ideas ?
...
I have a lil piece of jqery code here:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
hasVBar="";
hasHBar="";
$(document).ready(function() {
// Check if body height is higher than window height :)
if ($(document).height() > $...
I want to handle a xml like this:
<GeocodeResponse>
<status>OK</status>
<result>
<type>street_address</type>
<address_component>
<long_name>Beijing</long_name>
<short_name>Beijing</short_name>
<type>locality</type>
<type>political</type>
</address_component>
<address_component>
<long_name>Beijing</lon...
IE bugs out on me with a large table by not redrawing the table when I add input's to it using jquery. It forces a redraw/update when I scroll the table up or down but otherwise it doesnt render the input properly.
<div style="overflow: auto;">
<table>
<tbody>
/// lots of rows
</tbody>
</table>
</div>
an...
Hi there,
I am a C/C++ programmer, and I am currently playing with some Javascript code, and I am having problems finding where the documentation is for the standard Javascript libraries that are available in the browser.
Specifically, I am setting an onload callback function on a HTMLImageElement, created with new Image(). I also want...
I put together some sample code to show what I'm talking about, but basically I need to dynamically add a bunch of HTML to a page that happens to contain a Flash movie that is relying on FlashVars being passed in from the html.
The problem is that when you dynamically add a flash object to the DOM in IE, it overwrites all of the param e...
I have a custom publishing page content type, based on the Publishing Article Page content type. On this content type, I have a custom field named "PageContentCategory". In my code to create new pages, I tried this:
PublishingPage newPublishingPage = this.currentPublishingWeb.GetPublishingPages().Add(pageName, newPageSelectedLayout);
i...
I have this HTML
<li>
<a rel="1" href="/jobwall/job/1">
<img src="http://lcl.moovjob.com/media/images/employers/simonainleydotinfo.jpg">
</a>
</li>
and I have this javascript
$('ul#jobs li a').mouseenter(function(){
$(this).parent().addClass('active');
$.ajax({
type: 'POST',
url: '/jobwall/j...
I googled and googled and I concluded that it's very hard to get answer on my own.
I am trying to use jquery or JavaScript to get a property of clicked element. I can use "this.hash" for example - it returns hash value I presume.
Now I would like to get name of the class of clicked element.
Is it even possible? How? And where would I...
Ok, I have just spent the whole day playing with DomDocument and creating some cool things. The only thing I cannot figure out is how I can delete an attribute of a DomElement.
...
So I want to store some information in localstorage of a browser when the page is refreshed or the user exits the page for future use. I figured that I'd use some Javascript to detect the event and store the state of the page visit.
Now my predicament is: shall i use Onbeforeunload or Onunload method to accomplish this objective?
Tha...
<html>
<style type="text/css">
a {
display: none;
}
</style>
<body>
<p id="p"> a paragraph </p>
<a href="http://www.google.com" id="a">google</a>
</body>
<script type="text/javascript">
var a = (document.getElementById('a')).style;
alert(a.display);
v...
Hi everyone,
i want to load the content of different html-files (all on the same server/in the same directory) for further processing. For this i want to use the loadHTMLfile method, but it seems i'm not able to create a DOMDocument object on the external Server.
Testcode:
<?php
if(!class_exists('DOMDocument')){
echo 'No DOM! ';
}
if(...