Click here to Skip to main content
15,886,110 members
Everything / Programming Languages / Javascript

Javascript

Javascript

Great Reads

by Colin Eberhardt
This article describes the development of a cross-platform HTML5 application for Windows Phone and iPhone.
by Steve Krile
Fully AJAX-enabled user control used to select names from a database in a drop-down format.
by Marcelo Ricardo de Oliveira
A shoot'n'up HTML5 game made with Phaser game framework
by Serge Desmedt
A try it yourself guide to the basic math behind perceptrons

Latest Articles

by Jeremy Falcon
Just a simple routine and helper routine to generate unique IDs suitable for disconnected systems.
by Xavier Junqué i de Fortuny
Converts MathML coded string to/from plain text string
by Matthew Dennis
Create a ChatGPT-like AI module for CodeProject.AI Server that handles a long-running process.
by Akram El Assas
Microservices sample architecture using ASP.NET Core, Ocelot, MongoDB and JWT

All Articles

Sort by Title

Javascript 

2 Feb 2012 by cutexxbaby
i have this master page and a web form with the master page the problem i have is that the code wont run or save into the folder i want it to, so how do i change the code in the vb?basically i have a javascript which have a input that allow me to upload a file or image, but the problem, it...
3 Feb 2012 by Christian Graus
I think your 'mappath' needs to start with a / to map to the application root. Beyond that, based on your vague description, I'm not sure what's going wrong or what the problem could be.
10 Jun 2018 by Member 13835151
I'm attempting to use if (!array.includes()) { in order to check a user inputted word against a randomly chosen word in an array to see how many letters the two have in common and slice out all words in the array that don't have those letters. But !array.includes() does not seem to be...
10 Jun 2018 by phil.o
Have you tried putting the whole expression between brackets for the negated part? Something like: if (!(possWords[f].includes(compWord[e]))) I don't do much javascript, but this is what I would try if I would be facing your issue. Kindly.
10 Oct 2020 by Member 14168791
inserting CrLf in JAVA string does not work My code function printpage() { var originalContents = document.body.innerHTML; var printReport = document.getElementById('textbox1').innerHTML; ///Content to be printed ...
10 Oct 2020 by OriginalGriff
Because HTML doesn't recognise "/r/n" style newlines: try an HTML newline instead: printReport = printReport + "" + 'Adding some other text';
25 Dec 2022 by weti09
So I wanted to make a color changing background. The script works fine and I'm happy with it. But now there is the error that background is null. const scroll = ( color, selector, offset ) => { const [red, green, blue] = color; const...
25 Dec 2022 by Sandeep Mewara
const background = document.querySelector( selector ); As stated here: Document.querySelector() - Web APIs | MDN[^] The Document method querySelector() returns the first Element within the document that matches the specified selector, or group...
6 Mar 2018 by Arthur V. Ratz
In this article, we'll discuss how to produce user-to-item recommendations by using SVD++, Pearson Correlation and probability-based similarity computation.
31 Dec 2014 by Member 11262250
please help ... there is green line under all control and appear errors while running
31 Dec 2014 by Sergey Alexandrovich Kryukov
ASP.NET elements and attributes are case-sensitive, because the ASP.NET markup language is based on XML, should well-formed:http://msdn.microsoft.com/en-us/library/w7w4sb0w%28v=vs.140%29.aspx[^].It's , not
11 Aug 2013 by sanket_05
How can I enable "Hangout on Air" through a regular Google hangout JavaScript API??I am using regular Google hangout app and it is linked from my website. But now I want to add an additional feature of allowing users to record the conversation and post it in to Youtube channel using "On...
17 Jul 2015 by OriginalGriff
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.Try it yourself, you may find it...
16 Apr 2013 by arbaaz jalil
I am creating a wall using a UserControl ( which is a nested GridView) i want to load the rows of the GridView on scrolling down just like facebook. I am trying to implement this method.. Click MeClick here The example seems to read the last row's first column to get the last row which is loaded...
16 Apr 2013 by _Amy
Check the value of your hiddenfield before converting it to integer. This problem may occur due to an empty string in HiddenField.Try this:protected void btnGetMoreRecords_Click(object sender, EventArgs e){ if(hiddenLastProductID.Value.Trim() != ""){ //Fetch 14 records...
29 Jul 2023 by Arisz7
I accidently delete my old deploy from vercel that it was working just fine, it's an spotify clone and it was perfect y tried to recover the project by deploying it again but when I tried to recover everything from my supabase database I was able...
8 May 2019 by Member 12702056
html of the page: Account Setup ...
7 May 2019 by OriginalGriff
Compiling does not mean your code is right! :laugh: Think of the development process as writing an email: compiling successfully means that you wrote the email in the right language - English, rather than German for example - not that the email contained the message you wanted to send. So now...
8 May 2019 by W Balboos, GHB
You click the button and how does it know what to do? Also, it looks more like jQuery than plain javascript. And, of course, including parts of the code that have no relevance to the problem. Of course, reading the code and commentary, I have a very strong suspicion you copied the whole thing...
5 Apr 2020 by Member 14792643
New coder here I need help wording what i need so i can better understand what im trying to accomplish. I revised my question to try better explaining what im after! The JavaScript code has an array of objects that gets iterated over to create a...
4 Apr 2020 by Sam_k_khan
Try giving proper description of container_div. Write the html of container_div here so that problem can be evalvated easily. Furthrmore try getting your id first for when you click on the button it should first alert its id so that you make sure...
6 Sep 2018 by Member 13944776
"Please stop hotlinking this script" Warning What I have tried: Kindly guide how can I clear this issue..
6 Sep 2018 by CHill60
See the information posted here... https://blog.sucuri.net/2013/05/who-really-owns-your-website-please-stop-hotlinking-my-easing-script-use-a-real-cdn-instead.html[^] Or any search engine
6 Sep 2018 by F-ES Sitecore
You can clear it by stopping hotlink their script.
3 Feb 2019 by V. Subhash
For a more customizable "reading mode" or "article view" in your browser when reading news and articles.
21 Sep 2011 by Member 8022411
How to create a search engine in php or javascript. I do not want to connect with the database..I have read the data from an xml file and displayed it in an HTML table with border in the php webpage.. Pagination is also done for displaying the data and I got stuck with "search"...
28 Sep 2011 by Sunasara Imdadhusen
You can do XML searching using JQueryReading XML with jQuery[^]
20 Mar 2023 by Luigi Sansone
Hi guys, i'm a newbie tryn to develop a WEB App in Node JS. What i'm doing is downloading a PDF file from a FTP server and merging it(using PDF Merger plugin) with an other one coming from the Front End User. Here is the part of my code throwing...
25 Apr 2011 by Wayne Ye
"Unique URL Pattern" in Ajax Web Application
16 Oct 2006 by azharkhan
This article provides the steps to solve the "Unrecognized Tag" problem for an Atlas control.
5 Feb 2023 by OriginalGriff
First off, DON'T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalization if you want to be taken seriously. Secondly, I ask myself why you can't add what...
5 Feb 2023 by Richard MacCutchan
1. See JavaScript Timing Events[^] 2. Every time either car moves you need to check their positions. The position of the rear end is (probably) position plus length of car.
17 Feb 2015 by Member 11449483
hello,my URL in local host ishttp://localhost:63292/eFASTManifolds/Default.aspx#login_form thats by login form popup not shows in IE7 Or IE8 .so please give me any alternate solution to replace # in url and if you have other alternative then please give me.href="#login_form"...
24 Mar 2015 by Sebastiaan Meijerink
Looks like you are using some kind of client side routin mechanism. These rely on the hashchanged event of the current location.Older IE's don't support this.Have a look at hasher.js, which should help to resolve that problem.
17 Mar 2014 by aetheon
#javascript Require.js vs CommonJS / AMD modules and #angularjs
1 Jun 2014 by aetheon
#nodejs Ghost init.d service with forever.js
9 Jul 2013 by Aatif Ali from Bangalore
Hai All, $( "#dialog" ).dialog( "open" ); is not working in one page I implemented this function in one another page in the same project.its working fine but It not working in other page..My code shown as followsYour session will expire in another 1...
10 Jul 2013 by Aatif Ali from Bangalore
I solved This problem..actually its not a general problem..i found error using firebug " $ is not defined".I replace $ with $j.Everythng working fine...Thanks to allAAtif
15 Nov 2011 by tryharder
What does $("a") or $(document)really do? How did they define it?(I know it's a $ function)I am just going through the jQuery by myself. I found the jQuery syntax is very peculiar, and not well defined. ( I guess most people just try to remember the why the jQuery requires everyone to do)...
15 Nov 2011 by Sergey Alexandrovich Kryukov
Unlike other similar languages, in JavaScript the dollar sign ('$') is a character which can be used as a part of name, pretty much like any letter or underscore. So, a name can start with this character or contain just one dollar character. This character is often used in jQuery.See...
4 May 2015 by Rashmi Sutar
HI,I want to change the images after clicking on div..it works fine for Chrome and Mozilla but it is not working in IE9Please suggest,Thanks in advance..
5 May 2015 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
It perfectly works on IE 9, I tested. But you mentioned Sharepoint site. I am not sure about that. May be some script is blocked or something. Else jQuery is not referred correctly / conflicting with some other version.So my suggestion is that, please go to IE browser F12 and see the console...
6 May 2015 by Rashmi Sutar
Hi,Earlier I had used "background-color:transparent!important;" css to the div, then div click event didn't worked in ie9but now I have used "background-Red!important;"It works fine for me, so this is issue associated with transparent background.Thanks.
31 Aug 2018 by User 13204940
Hi, I'm developing a site here[^]. I've disabled body scrolling and enabled scrolling on #page, which means I need to assign a height manually. I do this every 500ms by setting the height of #page to $(window).height() minus the page's top and bottom 16px margins, and the header's top and...
31 Aug 2018 by Richard Deeming
The site looks the same for me in Chrome, Firefox 61, Edge, and IE11. If you can drop support for old versions of IE, you might do better with Grid layout - no Javascript required: Demo[^] Can I use... CSS Grid Layout[^] A Complete Guide to Grid | CSS-Tricks[^] Grid by Example[^]
23 Apr 2013 by rajan1189
$(window).load (function() is not working when i redirected this page from other page using anchor tag.... my page is not loading..i have to use this only not document.ready .. thanks in advance
24 Apr 2013 by Somnath Leo
Write this after the html ( all design code ) $(window).load (function() {//code goes here...});//doc ready
24 Apr 2013 by SIJUTHOMASP
Would you please specific on the comment "my page is not loading". Does it mean that the redirected page itself not loaded or your (window).load didn't work. Please provide more details?Thanks,Siju.
13 Mar 2015 by Member 11470912
$(’li:has(a)’) what this query do ....What is the output of this Code.I have seen this in a Code but i dont understand what the actualy happen
13 Mar 2015 by Sergey Alexandrovich Kryukov
This is the combination of element selector with :has() selector. The documentation is crystal clear: http://api.jquery.com/has-selector[^].See also:http://api.jquery.com/element-selector/[^],http://api.jquery.com/category/selectors[^].—SA
30 Sep 2013 by Ronnie22
I have two filessearh_journal.phpfunction submitForm() { var form = document.myform; var dataString = $(form).serialize(); $.ajax({ type: 'POST', url: 'journal_table/get_data_journ.php', data:...
30 Sep 2013 by Kamran Ayati
perhaps you can not correctly connectand then php cant to recieve data
6 Aug 2015 by Sujith Karivelil
Am creating a popup with Dynamic textbox and make it to select date by assigning Datepicket to it by using jquery as follows: Dim htmlString As string= "" & _ "$.noConflict();" & _ ...
18 Dec 2016 by Ningomba
$http in Angular simply explained
14 Sep 2016 by VarunSharma43
I am having issues with http post and getting 415 error all times. I attached the code which has all that i triedWhat I have tried:all i tried from various site to just do a post to a test method but all failed with same error 415. Please see attached code. It has all that i tried with...
14 Sep 2016 by Patrice T
Quote:I am having issues with http post and getting 415 error all times. I attached the code which has all that i triedAll what can be deduced is that you have a bug.But what bug and where is a mystery, just like your code.Asking questions is a skill[^]
8 Aug 2015 by baotdinh
Hi all,i am learning Angularjs . i have a code:controller.js $scope.save = function (position) { $http.post(serviceBase + 'Positions', { model: $scope.position }) .success(function (data) { });$scope.position already returns an...
23 Jul 2015 by Satheesh Santhosh
Here my sample angular app, i'm trying to remove the # from the address by using $locationprovider. But it's not working for me in all my angular app. so can anyone download my sample project and using the $locationprovider to remove the # and upload me again.Even XMLHttpRequest are also not...
30 Jul 2015 by Fernando Cortes Flores
IF you want to delete the '#' tag from the address you must use $locationProvider on your module config.$locationProvider.html5Mode({enabled: true, requireBase: false});You must change your links. For example: href="/testtwo"On the other hand the XMLHttpRequest. You are trying to...
16 Nov 2017 by Member 13524844
Try to call webapi using asp.net . while calling javascript function by onclick event from client side .it is not working with below code Please give me solutions for this. What I have tried: // document.getElementById("button1").onclick = function () { myFunction() }; ...
16 Nov 2017 by Karthik_Mahalingam
you have declared Eid and Epwd inside the button click event and you are trying to access the variables inside another method, so the value will be undefined and moreover in the data attribute of the ajax method you are passing only one parameter make sure you are passing all the values. pass...
30 Sep 2014 by kavitha3
Hi..!' window.ShowModalDialog ' not working in Chrome. But ,working perfectly in IE and Mozilla firefox.Please Help ...!Thanks in advance
30 Sep 2014 by VC.J
Hi Kavita3,Its a known issue in chrome browseryou can use window.open();hope that will do for you
30 Sep 2014 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
Yes Vipin is correct.Adding to his answer, I am referring the answer - Why is window.showModalDialog deprecated? What to use instead?[^]
10 Mar 2019 by Member 14105304
let american = "color"; let rainbowRegex= /colou?r/; rainbowRegex.test(american); // Returns true -- why? What I have tried: to understand and try another examples. but still, i understand nothing
10 Mar 2019 by OriginalGriff
Because '?' on it's own (without '*' or '+' in front of it) says "zero or one" of the preceding element. So "colou?r" matches either "color" or "colour" but not "colotr". As I suggested last time, get a copy of Expresso[^] - it's free, and it examines and generates Regular expressions. It would...
10 Mar 2019 by Wastedtalent
The u is optional in the regex, as denoted by the ? So both 'color' and 'colour' will match. Type colou?r in to the regex box on here to see: Debuggex: Online visual regex tester. JavaScript, Python, and PCRE.[^]
10 Mar 2019 by Patrice T
Quote: '? ' - Regular expression - js Advice: read documentation. Here is a link to RegEx documentation: perlre - perldoc.perl.org[^] Here is links to tools to help build RegEx and debug them: .NET Regex Tester - Regex Storm[^] Expresso Regular Expression Tool[^] RegExr: Learn, Build, & Test...
16 May 2012 by gani7787
I am getting 'Access Denied' Error when i am trying to open pdf file using javascript open window.I have mentioned the path already. But, the pdf page is not coming and also getting 'Access Denied' Error.see code and path------------------ function openwindow(url,title) { ...
16 May 2012 by Sanjeev Alamuri
use the url this way!!!!!var url="C:/\Documents and Settings/\sanjeev.a/\Desktop/\practicingApp/\Visual-Studio-vNext-Preview-Web[1].pdf";
28 Aug 2013 by Ramkumar K
Please Help me,i have pasted my full js code here..$(function (){ //alert('Im Ready'); var db = openDatabase('Test', '1.0', 'Test', 2 * 1024 * 1024); db.transaction(function (tx) { tx.executeSql('drop table countries '); tx.executeSql('CREATE...
5 Feb 2014 by Member 10454592
I updated my aspx pages, but got 'jQuery' is undefined. The related code in the .aspx is below:
5 Feb 2014 by Ankur\m/
As a prerequisite, jQuery UI requires jQuery library be loaded on the web page.Add a reference to jQuery just before you call jQuery UI and the error will go away.If you are using Google CDN, you can add the below line:
5 Feb 2014 by CoderPanda
There doesn't seem to be reference to jQuery itself. Please add one such as this. You may want a newer version though. [Please accept/up-vote answers or solutions that work for you to encourage...
6 Mar 2015 by Member 10918596
'max' is not a valid identifier in div.how to get value from back end via div id. 5 star ...
24 Jan 2020 by NJ44
Hi,I have an anchor element placed on my HTML page, which is under some conditional statement:@if(someCondition){IOP - In Plan}CSS:a.inactiveLink { pointer-events: none; cursor: default; ...
16 May 2016 by Kornfeld Eliyahu Peter
The pointer-events CSS property not supported in IE before version 11...
28 Dec 2016 by Member 12546977
Instead of doing it using css , try to set attr/prop using jquery If you are using jQuery
24 Jan 2020 by Member 14725965
I was facing exactly same problem. By adding css property 'display: block' to class, it worked on IE 11. I'm just using that now along with 'pointer-events: none'.
12 Aug 2014 by Ronnie Mukherjee
How does 'this' in JavaScript differ from 'this' in other languages?
24 May 2000 by Glenn S. Peffers
An article describing JavaScript code that will display a message (i.e. Please Wait...) while a Java Applet is loading. This code is designed to work in both IE and Netscape
18 Jun 2011 by hmoooda
i need call two javascript function by use Page.ClientScript.but when i use Page.ClientScript.RegisterStartupScript(this.GetType(), "onload", "onload()", true);i can't use this agin in same pageexample this codePage.ClientScript.RegisterStartupScript(this.GetType(), " onload",...
18 Jun 2011 by nit_singh
The second parameter in RegisterStartupScript is KEY. So if the script is already added to the page with that key, it will not add it again.So change the key If you want to execute the script again.Using IsStartupScriptRegistered you can check if that key already registered on the...
18 Jun 2011 by Ed Nutting
Well of course - what you've done is try to overwrite the old registered method. RegisterStartupScript registers code in the onload method to run, the third parameter specifies this code. It does not add on lines of code the to event. Instead you need to register it all at once. Do something...
18 Jun 2011 by Monjurul Habib
http://forums.asp.net/t/1685244.aspx/1?Page+Client+Script+Overwrite[^]http://msdn.microsoft.com/en-us/library/z9h4dk8y.aspx[^]
20 Feb 2006 by creativesri
This article briefs you about sending mail using SMTP in HTML Format, which takes the default SMTP settings from web.config file
4 May 2023 by Lambkin 2023
Im just looking for some advice, anything you can share with me will be much appreciated. Thank you!! What I have tried: youtube/udemy and github. as well as some mobile apps
4 May 2023 by Graeme_Grant
This is a big question. The answer is it depends. However, based on how you asked the question it sounds like you have not done much programming, if any. Everyone has a different learning technique. Some learn from books, others from being...
9 Aug 2022 by Klein788
Hey all, I'm coding a discord bot and I've coded a function that fetches messages from a channel on discord, but the bot can't read messages. I couldn't solve the problem, can anyone help me? Error stack tree; An error occurred while...
23 Aug 2021 by Alexandra N.
Image link: https://imgur.com/gallery/HbJGoZW Input: Gahriel and Diana escape from the monster in the jungle GHARIEL Don’t worry too much, everything’s going to be okay Think about the positive side-- DIANA --There is no way I can do...
23 Aug 2021 by OriginalGriff
Start by looking closely at your input file: use a hex editor rather than a text editor because those often "translate" tabs and spaces making it harder to work out exactly what the data you will be working with contains. (I use PSPad, it's free,...
14 Dec 2015 by Ken Jobs
I wrote html & css for my table:My tableTo understand: Link .png14 cols x 12 rows (13th row: use the 1st cell only)thead 1 rowtbody- x1: 5 rows (value *1)- x2: 4 rows (value *2)- x3: 1 row (value *3)- Average: 1 row- Under "Average": 1 cell...
14 Dec 2015 by Sergey Alexandrovich Kryukov
There are two aspects of having the effect of cell selection.You can have cells of some child element of a cell which you give the ability to get keyboard focus. This is the least known and one of the most important techniques. To do so, just assign the property tabIndex of the given element...
18 Aug 2015 by Andy Lanng
Hi,I'm mostly looking for ideas, here.I have a main control with tabs and several child controls. I have done this A: to simplify the main control and B: because I will need to turn some features on / off and so not render some of these child controls.It now turns out that I will be...
18 Aug 2015 by Sergey Alexandrovich Kryukov
There is no such problem, whatsoever. In terms of passing objects to methods, there is no such thing as "large" object, because the references to the objects are passed, there is no object cloning, unless you specifically develop such mechanism. Of course, the object will be shared through the...