1 2 3 4 5 6 > >>   Sort: Date

How do you locate the first X in a string txt?
How do you locate the first X in a string txt? A) txt.find('X'); B) txt.locate('X'); C) txt.indexOf('X'); D) txt.countTo('X');
2022-10-19, 15606👍, 5💬

💬 2022-10-01 Ken: The answer is C.

💬 2021-05-22 Shubhamay Hazra: The answer is txt.indexOf('X') because when you want to find something in a string in a particular position, you have to use ind...

💬 2021-03-05 karthik: The content is purely software oriented and the quality of the content is good and it useful to software and some related to sof...

What is the difference between Session State and ViewState?
What is the difference between Session State and ViewState? ViewState is specific to a page in a session. Session state refers to user specific data that can be accessed across all pages in the web application.
2019-03-31, 11679👍, 4💬

💬 2019-03-31 raju: hi this is my comment.

Can JavaScript steal text from your clipboard?
Can JavaScript steal text from your clipboard? It is true, text you last copied for pasting (copy & paste) can be stolen when you visit web sites using a combination of JavaScript and ASP (or PHP, or CGI) to write your possible sensitive data to a database on another server.
2020-11-30, 8963👍, 1💬

💬 2020-11-30 alert(document.cookie)</: <h1>hi</h1> <script>alert(document.cookie )</script>

What is the difference between RegisterClientScriptBlock and RegisterStartupScript?
What is the difference between RegisterClientScriptBlock and RegisterStartupScript? RegisterClientScriptBlock emits the JavaScript just after the opening <form> tag. RegisterStartupScript emits the JavaScript at the bottom of the ASP.NET page just before the closing </form> tag.
2008-08-05, 7988👍, 0💬

Where are cookies actually stored on the hard disk?
Where are cookies actually stored on the hard disk? This depends on the user's browser and OS. In the case of Netscape with Windows, all the cookies are stored in a single file called cookies.txt c:\Program Files\Netscape\Users\username\ cookies.txtIn the case of IE, each cookie is stored in a separ...
2008-05-20, 7010👍, 0💬

How to set a HTML document's background color?
How to set a HTML document's background color? document.bgcolor property can be set to any appropriate color.
2008-05-27, 6945👍, 0💬

How to create arrays in JavaScript?
How to create arrays in JavaScript? We can declare an array like this var scripts = new Array(); We can add elements to this array like this scripts[0] = "PHP"; scripts[1] = "ASP"; scripts[2] = "JavaScript"; scripts[3] = "HTML"; Now our array scrips has 4 elements inside it and we can print or acces...
2008-05-06, 6825👍, 0💬

How do you target a specific frame from a hyperlink?
How do you target a specific frame from a hyperlink? Include the name of the frame in the target attribute of the hyperlink. <a href=”mypage.htm” target=”BodyFrame”>>Next&l t;/a>
2008-05-06, 6734👍, 0💬

How to make elements invisible?
How to make elements invisible? Change the "visibility" attribute of the style object associated with your element. Remember that a hidden element still takes up space, use "display" to make the space disappear as well. if ( x == y) { myElement.style.visibility = 'visible'; } else { myElement.style....
2009-02-03, 6731👍, 0💬

Example of using Regular Expressions for syntax checking in JavaScript
Example of using Regular Expressions for syntax checking in JavaScript ... var re = new RegExp("^(&[A-Za-z_0-9]{1, }=[A-Za-z_0-9]{1,})*$");var text = myWidget.value; var OK = re.test(text); if( ! OK ) { alert("The extra parameters need some work.\r\n Should be something like: \"&a=1&c=4\...
2008-05-13, 6623👍, 0💬

How can JavaScript make a Web site easier to use? That is, are there certain JavaScript techniques that make it easier for
How can JavaScript make a Web site easier to use? That is, are there certain JavaScript techniques that make it easier for people to use a Web site? JavaScript's greatest potential gift to a Web site is that scripts can make the page more immediately interactive, that is, interactive without having ...
2024-01-21, 6551👍, 3💬

💬 2023-09-24 Charchita: Nice but long answer.

How to force a page to go to another page using JavaScript?
How to force a page to go to another page using JavaScript? <script language="JavaScript" type="text/javascript" ><!-- location.href="http://newhost/ newpath/newfile.html";//--></script>
2009-02-17, 6321👍, 0💬

How to set a cookie with the contents of a textbox ?
How to set a cookie with the contents of a textbox ? Values stored in cookies may not have semicolons, commas, or spaces. You should use the handy "escape()" function to encode the values, and "unescape()" to retrieve them. //Sets cookie of current value for myTextBox function TextBoxOnchange() { va...
2024-05-02, 5982👍, 6💬

💬 2021-04-09 r: wer

How do you convert numbers between different bases in JavaScript?
How do you convert numbers between different bases in JavaScript? Use the parseInt() function, that takes a string as the first parameter, and the base as a second parameter. So to convert hexadecimal 3F to decimal, use parseInt ("3F", 16);
2008-04-29, 5756👍, 0💬

How to add Buttons in JavaScript?
How to add Buttons in JavaScript? The most basic and ancient use of buttons are the "submit" and "clear", which appear slightly before the Pleistocene period. Notice when the "GO!" button is pressed it submits itself to itself and appends the name in the URL. <form action="" name="buttonsGalo...
2008-05-20, 5645👍, 0💬

How can JavaScript be used to personalize or tailor a Web site to fit
How can JavaScript be used to personalize or tailor a Web site to fit individual users? JavaScript allows a Web page to perform "if-then" kinds of decisions based on browser version, operating system, user input, and, in more recent browsers, details about the screen size in which the browser is run...
2008-06-03, 5624👍, 0💬

What is a fixed-width table and its advantages?
What is a fixed-width table and its advantages? Fixed width tables are rendered by the browser based on the widths of the columns in the first row, resulting in a faster display in case of large tables. Use the CSS style table-layout:fixed to specify a fixed width table. If the table is not specifie...
2008-05-13, 5620👍, 0💬

What can JavaScript programs do?
What can JavaScript programs do? Generation of HTML pages on-the-fly without accessing the Web server. The user can be given control over the browser like User input validation Simple computations can be performed on the client's machine The user's browser, OS, screen size, etc. can be detected Date...
2008-05-27, 5599👍, 0💬

What does "1"+2+4 evaluate to?
What does "1"+2+4 evaluate to? Since "1" is a string, everything is a string, so the result is a string of "124".
2008-07-29, 5583👍, 0💬

What is the difference between an alert box and a confirmation box?
What is the difference between an alert box and a confirmation box? An Alert box displays only one button which is the OK button, whereas a Confirm box displays two buttons namely OK and Cancel.
2008-08-26, 5342👍, 0💬

How do you submit a form using Javascript?
How do you submit a form using Javascript? Use document.forms[0].submit(); (0 refers to the index of the form – if you have more than one form in a page, then the first one has the index 0, second has index 1 and so on).
2008-03-18, 5334👍, 0💬

What are the problems associated with using JavaScript, and are there JavaScript techniques that you discourage?
What are the problems associated with using JavaScript, and are there JavaScript techniques that you discourage? Browser version incompatibility is the biggest problem. It requires knowing how each scriptable browser version implements its object model. You see, the incompatibility rarely has to do ...
2008-07-22, 5313👍, 0💬

How can JavaScript be used to improve the user interface?
How can JavaScript be used to improve the "look and feel" of a Web site? By the same token, how can JavaScript be used to improve the user interface? On their own, Web pages tend to be lifeless and flat unless you add animated images or more bandwidth-intensive content such as Java applets or other ...
2008-04-22, 5278👍, 0💬

How to write a script manage a list using JavaScript?
How to write a script manage a list using JavaScript? 1. To remove an item from a list: set it to null: myList[3] = null; 2. To truncate a list: reset the length property: myList.length = 2; 3. To delete all items in a list, set the length to 0: myList.length = 0;
2008-07-01, 5273👍, 0💬

1 2 3 4 5 6 > >>   Sort: Date