dom

Accessing JavaScript Objects from vb.net

五迷三道 提交于 2021-01-29 07:02:11
问题 I'm working on a vb.net application that interacts with a (third party provided) web app to provide additional functionality (e.g. removing menu items, pulling information from the pages, etc.). The web app is completely driven by javascript but is hosted in asp.net and is only used with Internet Explorer. I'm trying to read properties from a javascript object and execute some of it's functions. I've managed to get hold of the javascript object by getting the mshtml.HTMLDocument of the iframe

Accessing JavaScript Objects from vb.net

三世轮回 提交于 2021-01-29 06:56:20
问题 I'm working on a vb.net application that interacts with a (third party provided) web app to provide additional functionality (e.g. removing menu items, pulling information from the pages, etc.). The web app is completely driven by javascript but is hosted in asp.net and is only used with Internet Explorer. I'm trying to read properties from a javascript object and execute some of it's functions. I've managed to get hold of the javascript object by getting the mshtml.HTMLDocument of the iframe

ScrollIntoView in React without refs?

谁说我不能喝 提交于 2021-01-29 06:10:04
问题 I have a big list of items / divs that I need to create programmatically , and I need to implement scrollIntoView buttons for each them. I know how to do it with refs. Whether there is an alternative to refs that might be more performant? 回答1: I believe something like this will work: onScrollClick(ev) { ev.target.scrollIntoView(); } render() { return ( ... <button onClick={this.onScrollClick}>Scroll This Element Into View</button> ) } That assumes you want to scroll the button itself into

How to Benchmark Javascript DOM Manipulation

六眼飞鱼酱① 提交于 2021-01-29 05:28:33
问题 I have two javascript functions that do same thing: create a menu based on a json object. One function appends all the <ul> and <li> elements to a variable, and then writes the HTML to the document using the method innerHTML The second function create DOM elements through createElement("ul") and appendChild() methods So I want to know which function is faster, but I do not know how to perform a benchmark test in javascript. my first function is buildMenutoString() and the second function is

I am forced to append my widget outside of <body>. What are the side-effect of doing so?

元气小坏坏 提交于 2021-01-29 05:23:45
问题 I am in a strange situation. I am a widget developer and one of my client is using my widget (written in svelte ) on their website. Unfortunately their website, written in wordpress has some strange MutationObserver code in it. The callback of MutationObserver actually messes up with my widget when any DOM nodes are changed. Following is the culprit code (comes from a plugin called twemoji): const cb = function (records) { for (var addedNodes, removedNodes, length, a, r = records.length; r--;

PHP DOM, Find the text within a certain div

安稳与你 提交于 2021-01-29 05:01:29
问题 I am currently working a developer tracker for a game without using regex. I have hit a road block when trying to parse html at certain parts. What I am trying to parse: <td class="alt1" id="td_post_139718"> <!-- message, attachments, sig --> <!-- icon and title --> <div class="smallfont"> <img class="inlineimg" src="images/icons/icon1.gif" alt="Default" border="0" /> <strong>Re: TERA's E3 2010 Coverage</strong> </div> My Code: $titleArray = array(); foreach($idArray as $id) { $title = $dom-

Copy select option ID value into hidden field with jQuery

蹲街弑〆低调 提交于 2021-01-29 05:01:10
问题 I've seen a few tutorials where you can copy the value of a select option into a hidden field like this: $("#my_stuff").change(function(){ $("#my_hidden_field").val($("select option:selected").val()); }); So if I had this... <select name="my_stuff" id="my_stuff"> <option value="Red">Red things</option> <option value="Green">Green things</option> <option value="Blue">Blue things</option> </select> ...and selected 'Red things', then 'Red things' would be copied into the hidden field value. But

Chrome Extension: How do I get a web page to access functions defined by my content script?

南笙酒味 提交于 2021-01-28 21:58:04
问题 I'm programming a Chrome Extension, and I'm having it inject a content script which iterates through a few elements and attaches an onclick property to them which sends a message to my background script to execute a custom function on the DOM (the function defined in content scripts). To send a message from the web page to the extension, I must specify the extension ID which, as of now, I was manually getting from the extensions menu. Could I manage to query something for the extension's own

How to get element attributes onAutocomplete with Materialize

别说谁变了你拦得住时间么 提交于 2021-01-28 21:55:09
问题 I am using the same Materialize Autocomplete on 3 input elements. Then on onAutocomplete() I need to get the ID of the element the autocomplete was used on so I can populate data in the right place. So I want to know if it was either autocomplete-input1 or autocomplete-input2 . How can I do that in pure javascript? <div class="col s12"> <div class="row"> <div class="input-field col s6"> <input type="text" id="autocomplete-input1" class="autocomplete" autocomplete="off"> <label for=

How to get element attributes onAutocomplete with Materialize

吃可爱长大的小学妹 提交于 2021-01-28 21:54:11
问题 I am using the same Materialize Autocomplete on 3 input elements. Then on onAutocomplete() I need to get the ID of the element the autocomplete was used on so I can populate data in the right place. So I want to know if it was either autocomplete-input1 or autocomplete-input2 . How can I do that in pure javascript? <div class="col s12"> <div class="row"> <div class="input-field col s6"> <input type="text" id="autocomplete-input1" class="autocomplete" autocomplete="off"> <label for=