javascript

jQuery script for clickNshow on a dokuwiki page

I am making a dokuwiki for our company, but because the documents tend to get very large, I want to collapse the sections and only show the headers. The sections should appear when the header has been clicked. The dokuwiki tips and tricks page shows a nice little jquery script that facilitates this click and show behaviour. I modified i...

Custom HTML in a day with FullCalendar?

Is there a way to add, specifically, form elements for every day that are distinguishable per day? Below is an example. I know FullCalendar is built to handle "Events", so from what I can tell in the docs, it's not really possible. But I'm not a Javascript guru either, so would anyone else know of a solution? I'm hoping to not have t...

Javascript function to add class to a list element based on # in url.

I am trying to create a javascript function to add and remove a class to a list element based on the #tag at the end of the url on a page. The page has several different states, each with a different # in the url. I am currently using this script to change the style of a given element based on the # in the url when the user first loads ...

Convert opacity to hex in Javascript

What would be the preferred way to convert opacity (0 - 1) to hex (00 - ff) in Javascript? My thoughts are to use an if statement to check if opacity is between 1 and 0.95 then use ff. Work my way down to 0. ...

Detecting support for a given JavaScript event?

I'm interested in using the JavaScript hashchange event to monitor changes in the URL's fragment identifier. I'm aware of Really Simple History and the jQuery plugins for this. However, I've reached the conclusion that in my particular project it's not really worth the added overhead of another JS file. What I would like to do instead...

Dynamically inserted input elements not showing up in ActionResult's FormCollection parameter

I am adding input elements in a view, dynamically, using JavaScript. But I am unable to find those inputs in my ActionResult's FormCollection parameter...: public ActionResult SomeAction(FormCollection fc) I am able to find static input elements in the View. And using FireBug, I can see that the inputs are inside of the form element, ...

Is there a way to stop Firebug from working on a particular site?

Is there some way to make Firebug not work at all on a website? ...

Automate Field Entry in outside site

I am attempting to automate the entry of data into form fields. The problem is that this data (user/pass) is not known by the user. I'm not expressly hiding it from them, but they also don't need to know it. This is used to automate logins on several of our outside partner websites, who do not want our agents knowing their passwords. Sa...

How do I distinguish between Windows 2008 and Windows Vista using javascript?

I need to detect the SO of the user in a web application (IE only). I am using the function BrowserDetect.OS from javascript, but it returns the same String ("Windows Vista") when called from Windows 2008 and Windows Vista, and I cannot distinguish the user SO. Is there a way to detect this difference? http://msdn.microsoft.com/en-us/li...

How can you get a list or traversable tree of bookmarks from within a Firefox Extension?

I am working on a simple Firefox Extension, and I need a list of the user's bookmarks. I have found the nsINavBookmarksService class which appears to be the recommended way of manipulating bookmarks since Firefox 3.0. Strangely I don't see a method that I could use to get a list of all the bookmarks in a folder. I need some way of creati...

Is is possible to parse a web page from the client side for a large number of words and if so, how?

I have a list of keywords, about 25,000 of them. I would like people who add a certain < script> tag on their web page to have these keywords transformed into links. What would be the best way to go and achieve this? I have tried the simple javascript approach (an array with lots of elements and regexping/replacing each) and it obviousl...

Unbind Events with JQuery: Does it work with events setup in HTML?

Hello all, I have a few onclick and on mouseover events in my html generated by PHP, something like this: <div onmouseover="fave('heart_<?php echo $row['id']; ?>';" class="heart"><a href=""></a></div> I wish to make use of unbind on the mouseover but it hasn't worked when I tried this: $('#'+ id).unbind('mouseover'); So I am gues...

Regular expression for validating month

What is the regular expression for validating a month with the leading zero? Passes regular expression: 01,02,03,04,05,06,07,08,09,10,11,12 Fails regular expression: 1, 00, 13 and up. ...

how to enable script debugging in visual studio 2008 when using Firefox

I'm using Firefox as my default browser and I'm trying to debug java script in side asp.net page visual studio 2008 with Firefox browser. how to enable script debugging in visual studio 2008 when using Firefox? by the way, I installed JavaScript Debugger plug-in for Firefox. ...

Is JavaScript allowed to call a remote web page during a click event?

When viewing the click in firebug, the call turns red (i.e. error) but I can't see the error because the page redirects. So is it allowed to call a remote website (in my case, its a 1x1 image using a standard url like http://www.example.com/becon). ...

Get month in mm format in javascript

How do I retrieve the month from the current date in mm format? (i.e. "05") This is my current code: var currentDate = new Date(); var currentMonth = currentDate.getMonth() + 1; ...

How to call function that inside JQuery Plugin From outside the plugin?

hi, i am using textarea elastic plugin JQuery. this is the plugin (function(jQuery){ jQuery.fn.extend({ elastic: function() { // We will create a div clone of the textarea // by copying these attributes from the textarea to the div. var mimics = [ 'paddingTop', 'paddingRight', ...

Simple Javascript question

I have products : offer_id in javascript and am getting value of offer_id dynamically. Let say I get products : 12345 but now instead of that I want it to be as products : ;12345, than how can this be achieved in javascript. I have tried : products : ';'.offer_id products : ';'."offer_id" products : ';'.'offer_id' products : ";".of...

jQuery Collapse (with cookies), default open instead of closed?

Hi. I've got a jQuery snippet which basically allows a user to toggle a div, open or closed - their preference is saved in a cookie. (function($) { $.fn.extend({ collapse: function(options) { var defaults = { inactive : "inactive", active : "active", head : ".trigger", group ...

Reading from the HTML DOM returns UTF-8 characters

I have a contenteditable div where I'm reading individual characters and sending them off to a server (for more background this is similar to Google Wave where typing a character automatically sends it) I was using a plain old html textfield before and everything worked fine until I "upgraded" to a contenteditable div. My problem is th...