Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 7 years ago. Improve this question I found some interesting behavior and I’m wondering why it’s t…
Tag: javascript
select2 – How to change the value to the first option of the list with jQuery?
I have a form with a select2 dropdown. The dropdown is in a “modal” window and I want to be able to reset my form when the modal is closed. Behaviour wanted: When the modal is opened, I want the default value to be the first option in my select. In this case, the selected value would be A (value
What is making these subnavs expand?
I’m looking at http://voky.com.ua/showcase/sky-mega-menu/examples/demo-personal.html and I can’t figure out what is making the subnavs expand. For example, hover over “Portfolio” and see the subnav expand. I’ve inspected all the elements around the nav items and I can’t fin…
Javascript findIndex is not a function
I have a json array: function to remove a item from json array When the code is running there is an error: findIndex is not a function error line Answer findIndex is not a prototype method of Array in ECMASCRIPT 262, you might need filter combined with indexOf, instead, it has the advantage of stopping search…
How to place Javascript in a separate file from HTML
I have this code placed in index.html, all together – Javascript and HTML. what I want is to place the JS into another, separate file called “pw.js”. I have created a blank JS file located in folder “js”. I have added it to (head) as well like this <script src=”js/pw.js&…
showing error while using JavaScript in JSP with Struts 2
My JSP code: on s:if, JSP shows compile time error when hovering mouse on it (like spell error red line under s:if), shows msg “Syntax error on token “if”, ( expected after this token” although this code works fine. No problem. My questions are: Why it shows error, although it works ? …
Prevent parent page from scrolling when mouse is over embedded iframe in Firefox
…without limiting the scroll inside the iframe or the need to specifically name/tag all scrollable elements. Imagine google maps widget embedded in parent page. When you zoom in the widget you don’t want the parent page to scroll, obviously. I thought an answer to my previous question solved the p…
Please explain to me prototypes in javascript using the code below
I am trying to use the prototype method of writing functions that can be implemented by strings to capitalise every first letter of every word. I would like to call this function like, This is the function I am trying to write: I had written it this way before: Answer I would like to call this function like, …
Place street view on major street rather than back street
Following code places camera on road closest to marker however its an back street and kind of useless for navigation. Is there way to place camera on nearest major street instead (in this case “Eastern Ave”) without changing marker’s position rather checking picking programmatically closest …
From where can I get list of all color patterns used by Google Charts?
Question is simple, by default Google Charts uses some predefined colors for factors on the charts. First four are: Blue #3366CC Red #DC3912 Yellow #FF9900 Green #109618 Fine. When your chart must display more factors on a chart then it takes: Purple #990099 Sea blue #0099C6 Pastel pink #DD4477 Above names ha…