javascript

Detect last week of each month with javascript

Hi, what would be a way in javascript to detect the last week of each (current) month. Or last monday of the month? ...

ajax multi-threaded

Can do use ajax to achieve true multi-threaded?if can ,how to do? please give me some related information,web site or books. thanks ~! ...

jQuery sum events on TD click

I have a simple table to simulate a Gantt chart. The idea is that each TD clicking trigger a sum of values stored in an hidden input text (an array of values), available in a TH (first son of TR tag). The row sum of these values, is shown on a final TD. Next, the code table: <table width="100%" cellspacing="0" class="datagrid_ppal"> ...

Finding An image tag using the alt text

I would like to know if it was possible using Javascript to find an image tag by its alt text. For instance I have this tag: <img src="Myimage.jpg" alt="Myimage"> would there be a way to obtain the tag by looking for the "Myimage" alt attribute? ...

Displaying success/failure messages from hidden iframe submit

I'm using the hidden iframe method to submit a form with a file upload field. I want to display a message back on the page using javascript and I'm not sure how to do this. If this was just a form with text fields I'd do an AJAX post and respond with a message I'd display in my callback function. I'm just not sure how to accomplish this ...

javascript - Google Chrome cluttering Array generated from .split()

Given the following string: var str = "one,two,three"; If I split the string on the commas, I normally get an array, as expected: var arr = str.split(/\s*,\s*/); Trouble is that in Google Chrome (for Mac), it appends extra properties to the array. Output from Chrome's debugger: arr: Array 0: one 1: two 2: three co...

Prototype - DOM Traversal with up()

I have the following structure: <form> <div class="content"> ... </div> <div class="action"> <p>Select <a class="select_all" href="?select=1" title="Select All">All</a></p> </div> </form> I am using Prototype's up() to traverse the DOM in order to find the <form> element in respect to the a.select_all. ...

Dictionary to Json object, "Expected expression"

I'm trying to convert a dictionery into a json object, so that I can work with it in my front end. sortFields = <%= SchrodersHtmlHelper.ToJson(ViewData["SortInfo"])%>; However, I keep on getting "Expected expression" for this all the time and I'm clueless why. Could anyone explain to me what I'm doing wrong? Edit: The conversion wor...

Jquery Galleryview

I am working on a site that requires a jquery Galleryview now I have everything set up but my images are not showing. here is my header code: <script type="text/javascript" src="/js/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="/js/jquery.easing.1.3.js"></script> <script type="text/javascript" src="/js/jquery.timer...

How can I hide an id from its contents in Javascript/jQuery ?

I have a bunch of this videos on this website with this source: <li id="vidLink-1498229769" class="videoContainer vidLink"> <a href="/p/watch/1498229769:GM1ryG4eoTA6sMZV9wtDEpocuehpzDni"> <span class="content-video-thumb-hover"></span> <img src="http://lockerz.vo.llnwd.net/o35/Lockerz/14/593/MEVIO-EmoGirlTV-SavesTheD...

Where do I put javascript functions in grails to have it accessible?

I have a script to check/uncheck all boxes on a form in a grails application that I am trying to call. I included the function (in <g:javascript> tags) in the head section of the page, and even added an alert before declaring the function to make sure the code block was being processed (it worked), but when I hit my check/uncheck all but...

jQuery + form + textinput > Is it possible to display one value in a textinput and submit another?

I'm working on an application where dates are passed as yyyy-mm-dd but displayed to the client as mm-dd-yyyy (US based client). I'm using a jQuery datepicker for selecting from/to dates in a report and would like to show the dates to the client as mm-dd-yyyy but when the form is submitted, submit as yyyy-mm-dd. Is it possible to displa...

How change the videos max of page with jQuery ?

I have one website here that contains videos to see, like youtube, and the videos are divided in pages, and in the source of this page I got this part of the source: <input type="hidden" value="12" id="vid_count"> <input type="hidden" value="422" id="vid_max"> <input type="hidden" value="12" id="vids_per_page"> The site contains 422 v...

javascript innerhtml issue

Hi, I'm trying to get the innerHTML value of a node. The value is D&O. When I try to get this value using innerHTML I'm getting D &amp[semicolon] O. Is there any option to get the exact value rather than encoded value using Javascript? Please help me. Forum prevents me from entering semicolon after &amp ...

How to encorporate encyption to FlexPaper

Is it possible to configure the FlexPaper reader to un-encrypt password-protected pdfs or swfs? Here is the use-case: User uploads a pdf My server would then convert the pdf to swf via pdf2swf Then somehow encrypt the swf with a password (not sure best way to do this) Then the FlexPaper would be able to un-encrypt the swf and display ...

Books about Javascript API design best practices

Hi, Anyone can suggest good books about Javascript API design good practices? What are the common practices developed by Google, Twitter, Facebook in their APIs. Code organization, request control etc. ...

how can i tell if a javascript function works across browsers

How can I tell if a given javascript function will work across browsers? For instance, I want to use String.trim() and I see that it works in Firefox, but will it work in all the other major browsers? I imagine there is a good doc online somewhere, but I can't find it. ...

Query String checks checkbox on different page

Hello I'm having a problem, I have a button on page1 that when clicked passes this url: http://www.example.com/page1.html?jquery=blogger once it's clicked will go to page2 where there are checkboxes. I need the checkbox associated with "blogger" (named: cf_538) to be checked once the page loads. <script type="text/javascript"> <!-- ...

Javascript / jQuery $.get(url) Title Parsing not Working

Even though the following works: http://jsfiddle.net/N7D5r/ My attempt at using the same code does not correctly get the titles. They return null, for whatever strange reason: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/...

Reset an asp.net validation control via javascript?

How do I reset an asp.net validation control via JavaScript? The current code sample clears the error message text but does not reset the validation control for the next form submission. var cv= document.getElementById("<%= MyValidationContorl.ClientID %>"); cv.innerHTML = ''; Update: Here is the full code sample of the form. I can...