How can I detect link in the selection?

If a user select text which are in an "a" tag I have to remove it. If a link larger than div it carets on new lines and when I start to select with middle I get only text. So how I can attain that purpose and get the link effectively? function...
more »

2017-04-22 21:04 (0) Answers

Edit an object in an array and display information

I've an array of objects (myData) which has objects with type "internal" and "external". I'm creating divs with class="box" out of the objects in array and displaying some information of the corresponding object. I've an edit button in the
more »

2017-04-22 19:04 (1) Answers

addEventListener() as a global function

I just caught up in a confusion. if suppose I implement addEventListener() as a global function (unlike as a method of some specific node like node.addEventListener() ) then does it act just like a usual global function or something goes under the ho...
more »

2017-04-22 12:04 (1) Answers

Document not defined in c9

Whenever I run my code, it gives me the following error message: ReferenceError: document is not defined at Object.<anonymous> (/home/ubuntu/workspace/random.js:1:63) at Module._compile (module.js:409:26) at Object.Module._extensio...
more »

2017-04-21 15:04 (0) Answers

PHP DOM traverse HTML nodes and childnode

I am using some code to pick out all the <td> tags from a HTML page: $dom = new DOMDocument; $dom->loadHTML($html); foreach ($dom->getElementsByTagName('td') as $node) { $array_data[ ] = $node->nodeValue; } This stores the data fine...
more »

2017-04-21 14:04 (1) Answers

In which html tags could be placed link

I am trying to extract all links from given url using simple_html_dom library like this: foreach($content->find('a') as $element) { if($element->href) { array_push($links, $element->href); } } My question is: ...
more »

2017-04-21 08:04 (1) Answers

Select id across multiple html pages

Hi am really trying to find someone to help me find the solution to this problem. I have two html pages and a js page with jquery page1.html <a id="test1"></a> page2.html <div class="navdown"> <ul id="top-menu"> ...
more »

2017-04-21 00:04 (2) Answers

domdocument get filesize on the fly

I'm creating a xml sitemap using php's DomDocument. When the document reaches 10MB, I want to create a new file and store the remaining data in it. I can't figure out how to get the current size of the document before it's save to the disk. I want so...
more »

2017-04-20 13:04 (0) Answers

PHP DOM parse data by traversing nodes

I'm using this code to fetch the data from a html table: $dom = new DOMDocument; $dom->loadHTML($html); foreach ($dom->getElementsByTagName('tr') as $node) { echo $node->nodeValue; echo '<br>'; } The data in...
more »

2017-04-20 12:04 (0) Answers

New div append, removing first one

We are showing an overlay message over a div, using the following code: showOverlay({workItem, overlay}) { let $container = $(this._listView.getItemContainerByKey(workItem.backlogItemId)), $overlay = $(overlay); $containe...
more »

2017-04-20 11:04 (0) Answers

php, how to clone DOMElement?

Official documentation says that DOMElement has inherited method cloneNode . If i try to clone, it does not work. How to copy element from one DOMDocument to another? Namely, i have misplaced head, thus ...
more »

2017-04-20 09:04 (1) Answers

python requests, what i am missing?

import requests a = '{"searches":[{"te":"coca%20cola","fi":"BRAND"}]}' b = requests.get(a) print(b.text) Here is a simple webpage. If I paste url in browser and open the link, I get the results I want to see. If...
more »

2017-04-19 23:04 (1) Answers