How do I fix comment showing on code in javascript?

iVers

Im trying to download jQuery into my document via my js file. when i do document.write however, the "https://" is marked as a comment.

function downloadjQuery() {
    document.open();
    document.write("<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>");
    document.close();
}
Bella

Your quote use is incorrect. You closed the quotes before the link.

Instead of:

document.write("<script src="link"></script>");

You should do:

document.write("<script src='link'></script>");

When you have to use quotes multiple times, you can also use ' instead of " four times. Also, if you want to keep the raw version of the comment, you can type \ before //.

Example:

(Correct Usage)

\//I printed a raw version of a comment.

(Incorrect Usage)

//I did not print a raw version of a comment.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How do I fix this comment SQL/PHP code?

Why is this code not working, How do i fix it?

How could i fix in Recursion code in javascript

How do I fix this calculator UI? (Javascript from code.org) I will explain down below

I'm working with Javascript, but VS Code gives me typescript intellisense. How do I fix it?

Why is IFormFile showing null, and how do I fix it?

Why is my actionbar not showing and how do I fix it?

How do I fix this 101 keeps showing at the end of result

Only the .lua extension type is showing.. How do I fix this?

How do I fix a sticky social icon that is not showing?

How do I fix this javascript foreach bug?

How do I fix it 'error: undefined' in javascript?

I have code showing up when I "Inspect" the page that isn't anywhere in what I've written and causing text color to be "wrong," how do I fix this?

How do you fix repetitive javascript code within multiple functions?

How do I fix my duplicate detection code? Java

How do i fix my code's vulnerability?

How do I fix my code about a script that stopped working?

Error in Python Code. How do I fix a skip?

Why is the constructor in this C++ code ambiguous and how do I fix it?

how do I fix this code - variable not defined in function

How do I fix my code for plotting a histogram?

How do I fix the indentation error in my code?

How do I fix this code to get the proper output

How do i fix the infinite loop that this code gets itself into?

How do I fix this R code for area under curve?

how do I fix my code in order to display one table?

How do i fix backgroundworker is busy c# code

How do I fix my code with Pygame to jump correctly?

Accidentally deleted flutter default widget code, how do I fix it?