codemirror-lint error not showing on click - javascript

I have installed code mirror on my project, I want to use lint on my editor everything works except the error message when I click on it like on the code mirror example: https://codemirror.net/examples/lint/ Thanks for your answers
enter image description here
here are the options for code mirror :
enter image description here
I use Angular 7

Related

Trying to export file and load app page from input page but getting error

`Hello, currently im buliding web app with js. I create 2 html files one is the app UI page and one is the login UI page. For login page my js code logic is that where you input correct nicknames to pres 'lets go' button and change the href to app.html files(page).After that happen i get error for null property becouse i the 'let's go' butto who is in the login js file.
My point to all this is to lean how to switch from pages afte i put my login. Soon i will start back end but for now i need this for projects.
EDIT: Im doin it hard way. Will re-do it again this time only in one html and js file no export. I will leave the question if can someone give me some clues and advices im new in javascript.
enter image description here,
enter image description here,
enter image description here`

Cypress Automation - Cannot find button based on text

I am learning Cypress and have been automating various websites for the last few weeks. However, I am having issues clicking a button based on it's class or text value. (Supposed to be easy, I know)
The button does not have an id and has a long class name:
message-component message-button no-children focusable sp_choice_type_11 last-focusable-el
The following image shows the full element:
I have tried the following code:
cy.contains('Accept All').click()
cy.get('#message-component message-button no-children focusable sp_choice_type_11 last-focusable-el').contains('Accept All').click();
cy.get('button').contains('Accept All').click()
However, it just gives the same error and cannot find the button.
I have already checked the documentation for cypress and followed some advice off this post:
Find by text content
I also thought it may be that it loads the button after 4 seconds, so i upped the "defaultCommandTimeout" to 7000. However, still no luck.
Does anyone have any ideas?
Much appreciated!
*** EDIT ****
Image of the error
Screenshot showing popup in cypress:
The 'Accept All' button is inside an iframe. So you have to first go inside the iframe and then perform the click.
Install the cypress-iframe plugin using the command npm install -D cypress-iframe
Go to cypress/support/commands.js and write import 'cypress-iframe';
In your test write:
cy.iframe('[title="SP Consent Message"]').find('button[title="Accept All"]').click()

Having issues setting the input file text color in chrome [duplicate]

This question already has answers here:
How to customize <input type="file">?
(18 answers)
Cross-browser custom styling for file upload button [duplicate]
(7 answers)
Closed 5 years ago.
I am facing a strange problem only in chrome. I am trying to set the file input color on onClick event of a 'Save' button if there is some validation errors for file input. I tried jquery and simple javascript to set the color but none of them worked for me. This is a problem only in chrome because I tried in mozilla firefox and seems to work correctly.
I am using WebForms and I have a list of file inputs generated from c# code. The code in javascript is as below:
$("input[id^='DC_LVP5EMulti_FU5M_']").each(function (i) {
var index = $(this).attr("index");
//$("#DC_LVP5EMulti_FU5M_" + index).css('color', 'black');
document.getElementById("DC_LVP5EMulti_FU5M_" + index).style.color = "#000000";
});
Something I noticed while debugging in chrome, I set a file input color to red in console using document.getElementById("DC_LVP5EMulti_FU5M_2").style.color = "red"; statement and it worked but it did not have a file uploaded so the text was 'No file choosen' and after I updated all file inputs text color to black again the only one that did not change was the one that has not the text 'No file choosen' but the name of the file uploaded, so I guess the problem is when an input file contains a file and the text has been changed from 'No file choosen' to file name.
Does anybody faced this strange problem before ?
There are going to be limitations as to what you can do with a file upload control just because of security concerns. I don't know all the intricacies involved, but I do know that it's much easier to just style your control and hide the native control. Check out this example from another Stack Overflow question: Cross-browser custom styling for file upload button
You should be able to change the text and color to whatever you want then since you're just using plain old labels and divs/spans.

Click button on webpage via Applescript - Error

I'm trying to click on a webpage item via AppleScript but with no success.
I tried the following code in chrome and safari:
execute "document.getElementById('t-strikethrough').click();"
and
do JavaScript "document.getElementById('t-strikethrough').click();"
In Safari, the first line of code does nothing and the result section of Script Editor says missing value. With Chrome, I get the following error:
Can’t make "document.getElementById('t-strikethrough').click();" into
type specifier
This is included inside tell statements to locate app, window and document.
Without seeing all of your AppleScript code, it's difficult to see exactly what the problem is. You may want to try setting a variable for the URL like this:
set URL of document 1 to "http://www.whatever.com"
do JavaScript "document.getElementById('t-strikethrough').click();" in document 1
Check this post to see the full example . Click Button on Webpage with Applescript/JavaScript

My pictures are not shown in html

I have a problem with my work. I have to write Javascript file which will display me a website like this one http://tinypic.com/r/2iu47b6/8 . I have already given html and css file which am I not allowed to change. List of pictures in JS must be given as array.
I have to write function onInit() which starts after loading the site and creates XHTML code with list of pictures and paste it in cell with ID = "seznam". Other function must work that way when you click on picture it shows up in full size, like you can see on picture in LINK i posted.
Here appears my problem. I created JS file and my pictures doesn't show up when I open html website. If I try to open picture in new tab I get error "Failed to load resource: net::ERR_FILE_NOT_FOUND".
I have html, css and js files saved together in one map, and pictures in subfolder "slike", but my website anyway doesn't work.
Can someone please check my code, and help me? http://plnkr.co/edit/zD0Chi8WUqLPf1JaKwr2?p=preview
Thanks!
EDIT: Pictures imported to website are Sample pictures from Windows 7 if that helps.
Probably this line is the problem:
print =print+"<img src=\""+print[i]+"\" onClick=\"ShowPics(this);\" />"
It should probably be:
print =print+"<img src=\""+pictures[i]+"\" onClick=\"ShowPics(this);\" />"

Categories