getelementbyid

Check with VBA if an element exists on the page

青春壹個敷衍的年華 提交于 2020-02-02 15:12:25
问题 I have 15,000 products and I need to know if they're X, Y or Z. The code below checks on amazon to see if a product is a type of XYZ. God help me, it actually works. The only exception is when it searches a product no longer sold by Amazon. Then the element ID that I'm looking for which contains the product description that I'm searching doesn't exist on the page, and the code breaks on line text = document.getelementbyID("result_0").innertext with the error "Object variable or With block

Check with VBA if an element exists on the page

天涯浪子 提交于 2020-02-02 15:10:31
问题 I have 15,000 products and I need to know if they're X, Y or Z. The code below checks on amazon to see if a product is a type of XYZ. God help me, it actually works. The only exception is when it searches a product no longer sold by Amazon. Then the element ID that I'm looking for which contains the product description that I'm searching doesn't exist on the page, and the code breaks on line text = document.getelementbyID("result_0").innertext with the error "Object variable or With block

document.myform.checkbox.checked without a form

醉酒当歌 提交于 2020-01-26 02:47:08
问题 i know that what i mentioned on the question (above) isn't possible, but i have a problem here, i have double tripe and so on, forms inside a page, and i need to submit a form that gets all the data inside the previous forms. WARNING: I started with javascript like 3 or 4 days ago, i am used to the server-side programming. Let's see: javascript checks if checkboxes are checked (Several of them): function KeepCount() { var NewCount = 0; if (document.iphone3g.iphone3g1.checked) {NewCount =

Angular 2 - Provide 3rd-party library with element for rendering

喜欢而已 提交于 2020-01-25 04:13:17
问题 How would I provide a DOM element to a 3rd-party library in Angular 2? For example, if Library is the hypothetical 3rd-party library, and I had to do something like: var fakeId = document.getElementById('fake'); // e.g. canvas or SVG element var sirRender = Library.confiscate(fakeId); sirRender.drawMustache(); // accesses canvas context or manipulates SVG I am using Typescript and ES6 decorator component syntax. I'm imagining I can do something inside ngOnInit like: @Component({ ... }) export

Element.getElementById() not working

和自甴很熟 提交于 2020-01-24 07:53:27
问题 Basically, I'm unable to get the element text from following SVG: panel = document.getElementById("panel"); g = panel.getElementById("gtext"); t = g.getElementById("text"); t.textContent = "hello"; <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink= "http://www.w3.org/1999/xlink" width="80" height="80" id="panel"> <g id="gtext" transform="translate(0,48) scale(1 1)"> <text id="text"> XXXXXXXXXXXXXXXXXXX </text> </g> </svg> The inspector says the group gtext has no getElementById function My

Get value from select list in JS

纵然是瞬间 提交于 2020-01-15 20:12:16
问题 I know that this might be very simple question and I tried to find solutions in the web but I can't figure it... I have the following C# / ASPX code: SelectArea += "<select name=\"Area\" id=\"area\">" + "<option value=\"Default\" style=\"display:none;\">SELECT AREA</option>"; for (i = 0; i < ds.Tables[0].Rows.Count; i++) { AreaName = ds.Tables[0].Rows[i]["AreaName"].ToString(); SelectArea += string.Format("<option value=\"{0}\"/>{0}</option>", AreaName); } SelectArea += "</select>"; And this

document.getElementById sometimes returns null

南楼画角 提交于 2020-01-15 09:31:54
问题 I have a line of code that is called in the onLoad event of a page, and it works fine. Inside the onload event, other functions are called, and trying the same line of code now returns null. Code verbatim riskInStateInputTypeElement = document.getElementById("riskInStateInputType"); Are there any instances where getElementById begins returning null after having returned the correct thing previously? The line that works and the line that doesn't work are both in the same call stack, not

Is it possible to draw on multiple canvases at once?

狂风中的少年 提交于 2020-01-12 08:28:09
问题 All of my canvas drawing functions start something like this: function drawMe(){ var canvas = document.getElementById('canvas-id'); var ctx = null; ctx = canvas.getContext('2d'); ... } However I now want to draw the same image on a (variable) number of canvases, is there some alternative to getElementById() (perhaps in jQuery?) which can be used to easily grab more than one at once? Thanks! Josh 回答1: drawing to multiple canvases will be extremely inefficient, because rendering is one of most

Find and fill an input field with AutoHotKey

*爱你&永不变心* 提交于 2020-01-11 03:23:11
问题 A challenge to all you AutoHotKey masters: Give us a function that will Find and Move the Cursor to an Input Field (E.g. LoginName) and, alternatively send input text. For the old, lazy hackers like myself just fiddling with AHK, it would look like this: FindFillField(*elementid*,*sendtext*,*alt-text*) Where elementid is the HTML id for the field, e.g. USERNAME, where sendtext is the text to fill and where alt-text could be additional, specific text to help identify the fields. Additional,

FireFox Add-on: retrieve text from textbox in current tab gives no result

独自空忆成欢 提交于 2020-01-09 12:04:39
问题 I am trying to create an add-on that gets the contents (textbox.value) from a textbox with ID = city from the current webpage and write it to a text file. The file can be written without getting the textbox value. But, If I update the code then it writes nothing. Below is the code I used to get the textbox value. var cityfromfield = window.content.document.getElementById('city').value; var date = new Date(); var TimeStamp = date.toLocaleString(); var wstrtotext = TimeStamp + cityfromfield;