javascript

Can I embed a jsFiddle into stackoverflow questions/answers?

I found that embedded jsFiddle is very useful for readers, but I can't paste it into SO's questions or answers. Is there a way to do this? ...

Parse ONLY a time string with DateJS

I'm using the excellent (but large) DateJS library to handle dates and times in my webapp. I just came across something that I'm not sure how to handle. I want my users to be able to enter Time strings only, without a date, but they should be able to enter it in any manner they please. For instance: 5:00 pm 17:00 5:00pm 5:00p 5p etc. ...

Horizontal News Scroller in JavaScript

I think I would have gone through like a hundred websites but I do not seem to find the perfect horizontal news scroller for my website. My requirements are: 1) Must be smooth 2) Must scroll from right end of browser to left end (meaning 100% width) 3) Must be continuous (Meaning news-item-1 must be visible immediately after the last-ne...

jQuery not detach()'ing if it contains an input tag

Hi there I have a table which i need to move elements up and down in. I have the code working, but as soon as I add a tag to it, it throws the error: Error: this.visualElement is undefined Source File: http://192.9.199.11:83/templates/admin/js/jquery/ui.checkbox.js Line: 94 The HTML looks like this: <table width="100%" cellpadding=...

Restarting animated Gif

Hi, I want to put a timer onto my gallery rotation script. This timer is a circular animated gif. i want it to start again when a new image loads.. I would have thought that this would work but apparently not. // Loader needs to be a Global loader = new Image(); loader.id = "loader_graphic"; loader.src = "images/loader.gif"; var $cont...

What it the significance of the Javascript constructor property?

Trying to bend by head around Javascript's take on OO...and like many others running into confusion about the constructor property. In particular, what it's significance is as I cant seem to make it have any affect. E.g. function Foo(age) { this.age = age; } function Bar() { this.name = "baz"; } Bar.prototype = new Foo(42); ...

Changing the URL with jQuery without reloading the page

How do I change the URL with jQuery without reloading the page? ...

Parsing JSON with jQuery

Hey. I am trying to parse some JSON into HTML using jQuery. I’ve checked to see if my API request is working, and it is. I think it gets stuck when appending the HTML. $('button').click(function(){ $.getJSON('http://api.songkick.com/api/3.0/events.json?apikey=MY_API_KEY&amp;location=ip:94.228.36.39', function(data) { $('.js...

jQuery.ajax() success/failure callbacks called when?

I've been going through the source to find out the critiera for jQuery.ajax()'s success/failure methods being called. It is not based solely on the status code, it seems to also involve the data type. I always resort to writing custom error handlers using the 'complete'-callback. Exactly which are the critera for the success/failure ca...

Script not executed after FORM element

Hi, I have an .aspx page. I populate a public variable in the code behind (.cs) page and then access that variable in JS on client side. I have the script declared after the FORM tag as below :- <body> <form> ... </form> <script language="javascript" type="text/javascript"> debugger; var data = "<%=cSharpData%>"; ...

Javacript sorting object

Hello! I have a js object (name, noWords, score, group) flower - 1 - 88 - 0 flower - 1 - 99 - 0 flower,spring - 2 - 39 - 1 flower,spring - 2 - 58 - 1 flower,time - 2 - 20 - 2 flower,time - 2 - 53 - 2 spring,time - 2 - 55 - 3 flower,spring,time - 3 - 79 - 4 flower,spring,time - 3 - 121 - 4 I want to sort this object like this first mat...

MSword in a web browser or any other server control that has ruler in it.

I am developing asp.net with c#web application. I want to have a control in ASP.net that has text formatting controls as well as a ruler to edit the text which i enter in text area. It would be great if i can open Msword in a web browser without Save buttons at the client side.The data must be saved into the database. The control shoul...

JQuery Stack of Cards

Hi Guys, I have a stack of cards. They are stacked so each one has about a centimetre at the bottom visible. What I want, is when a card is clicked it moves to the right, then gets sorted to the top and moves to the left back onto the pile. I then wish to trigger a page change (to the page that's represented by the card). How would I d...

Improve creating excel sheet speed ( programatically)

I need to generate some kind of reports in excel via web system. My current code is as follow (simplified): //[javascript inside .aspx page] ExcelApp = new ActiveXObject("Excel.Application"); ExcelSheet = new ActiveXObject("Excel.Sheet"); ExcelSheet.Windows(1).WindowState = 2; ExcelSheet.Application.Visible = false; for (i=1; i< [ele...

How to change the colour of a databound html item at runtime?

I have some html which displays data from my database. Shown below is a line of code that shows if an item is enabled. What I would like to do is set its colour so that it is green when enabled and red when disabled. Can I add some javascript to this line to do this? <asp:Label ID="ifmgr_ase_enabled" runat="server" Text="<%# DataAdapter...

jquery cycle question

hi there, here is a challenging question for a javascript expert and/or someone who has worked with jquery plugin cycle see my demo: http://jsfiddle.net/atoswchataigner/L8fNS/ question: i can't get the js to display the image for the pager in the nav div (pagerAnchorBuilder in the js) best viewed in firefox thank in advance, Will ...

Changing styles of page using JS and CSS ?

I am trying to CSS assigned inside the head tag using JS, its not working for IE any idea why? IE just show "Unknown runtime error". <html> <head> <style id="style_id" type="text/css"> </style> </head> <body> <p>This is the test Text</p> </body> <script> var st = document.getElementById("style_id"); st.innerHTML = "p { color:re...

Small remake of this regexp to allow these special character in beginning...

I have this regexp: var desExp = /^\s*([\wåäö][^\w]*){3}.*$/gm; This is for validating a textarea. Currently, you cant use the three Swedish language letters in the beginning. The letters are å, ä, ö, Å, Ä, Ö. Also, I would like it to allow the minus sign and the star (multiplication) sign: - and * Is there any remake to allow ...

copy td background color and set div to the color when clicked

How can i take the bgcolor and title of a td and then set a div to that color and write out the title next to the div <div id="boxcolor1">change color</div><div id="boxtext1">write td title here</div> <table id="box1"><tr><td title="Maroon" bgcolor="#5A0014"></td></tr></table> I'm sure it's possible but i can't see it working for me...

jquery shifting of popup when content increases

Hello , I have one div which is dynamic and getting the increments in the css dynamically from jquery to fit the contents if they are larger. now the problem is that there is one popup associated with the same div. if content increase that popup's comes down, I don't know how to solve this issue . please help. HTML < div id='main...