javascript

IE8 corrupting the script src?

I have a page that includes a dynamic js-script depending on the page I'm visiting. However, I'm getting errors in my log from some IE8-visitors, where it seems like the actual request-url is completely mangled for the mentioned script. This is what it should fetch: <script type="text/javascript" src="?partial=filterjs&json=true&viewal...

How to access a control inside an ajaxmodalpopup in javascript?

Inside an Ajax popup I have a GridView. I want to access the GridView from javascript. As it is inside popup I am unable to use document.getElementById I used document.GetElementsByTagName and accessed popup in javascript. How to traverse to the gridview inside that popup? ...

Javascript: read number of any value.

I'm trying to apply a tooltip to a foreach loop, but I need the javascript to read the attribute "mystickytooltip" with a number at the end. <div id="mystickytooltip{$smarty.foreach.cart.iteration}" class="stickytooltip"> Will output <div id="mystickytooltip1" class="stickytooltip"> <div id="mystickytooltip2" class="stickytooltip">...

Convert json to a string using jquery

I have a nested json. I want to post it as a form input value. But, seems like jquery puts "Object object" string into the value. It seems easier to pass around the string and convert into the native form I need, than dealing with json as I don't need to change anything once it is generated. What is the simplest way to convert a json ...

What's the best way to find the first common parent of two DOM nodes in javascript?

My question is exactly that but in context I want to examine the selection object, compare the anchorNode and focusNode and if they are different then find the first common parent element. var selected = window.getSelection(); var anchor = selection.anchorNode; var focus = selection.focusNode; if ( anchor != focus ) { // find common...

JavaScript returns Access Denied

Hello, I'm running into a scenario where at random times I am getting "Access Denied" when executing javascript. It is not repeatable and occurs in random places of my application. There is not indication of what is causing it in the logs and I'm really at a loss on this. It seems to be UI problem only. However, there is no reason it sh...

javascript mouse cursor change on page load in firefox browser 3.5

Hi in case of full page submit a trasparent div id coming and changing the cursor to 'wait' . Now when the page is getting submitted and new page is coming up cursor still remains to 'wait' not changing to default until mouse is moved in Firefox Here is simple html click on show button div is coming when user move mouse over the div cur...

How do I add bookmark to blackberry using script?

Hello, I am making a web page for blackberry. I am required to add a link or button in the page which when click add the page to the bookmark (or menu if possible). I am allowed to use javascript. Please suggest a solution. In simple words: The webaddress contains an ip address and its getting too long. Ppl will avoid typing a long li...

Is there an on_tab_on2 event

I have a thumb gallery where I can hover over each thumb to trigger an associated pop-up to appear, but I would like to be able to also tab through the thumbs and make the associated pop-ups appear... Any help on how to go about doing this? function onhovering_and_tabbingon2() { $(".box img").hover( function () ...

How can you make the copyright text in a Google Map wrap when the map is small?

When you embed a Google Map on a web page, copyright text is included on the map. If you embed a map with a small width, the copyright text extends outside of the <div>, instead of wrapping onto two lines within it. This is the HTML that Google Maps inserts for the copyright text: <div style="-moz-user-select: none; z-index: 0; positi...

Right Click Context Menu Script for iFrame

The context of the problem is related to an application which is single-page Ajax application. The layout of the page consists of three different panels (iframes) as follows: _________________________________________________ | | | Frame A | Frame C |_______...

Map/Reduce on an array of hashes in CouchDB

Hello everyone, I am looking for a map/reduce function to calculate the status in a Design Document. Below you can see an example document from my current database. { "_id": "0238f1414f2f95a47266ca43709a6591", "_rev": "22-24a741981b4de71f33cc70c7e5744442", "status": "retrieved image urls", "term": "Lucas Winter", "urls"...

best way to store php data on a page for use with javascript/jquery?

Ok, so im trying to work out the fastest way of storing data on my page without slowing the page load: I need to store information in the page to be later used by jquery. My page is an events page and i want to attach data to each event anchor. there are 100+ events to attach data to. The events anchors are created with a php loop, s...

Javascript concatenate properties from multiple objects (associative array)

I am looking for the best way to augment multiple javascript associative arrays. For example the following code a = { "one" : 1, "two" : 2 }; b = { "three" : 3 }; c = { "four" : 4, "five" : 5 }; d = Collect(a,b,c) Should result in value of d being: { "one" : 1, "two" : 2, "three" : 3, "four" : 4, "five" : 5 }; What is the bes...

How to find the parent element using javascript

I want to change the background color of the table cell when radio button inside the cell is clicked. <table> <tr> <c:forEach items="#{books}" var="book"> <td align="center"> <h:selectOneRadio value="#{book.price}" onclick="this.parentElement.style.background-color='red';"> ...

Hide an html element using javascript only if browser is firefox

How can I hide a div with javascript if the browser is firefox only? ...

JQuery validate: how to place error messages inside the input's title attribute

Due to space limitations I'm trying to place the error messages for a form inside tooltips. $("form").validate({ rules: { username: { required: true, email: true }, password: "required" }, onkeyup: true, success: "valid", errorPlacement: function(error, element) { ...

setTimeout in javascript not giving browser 'breathing room'

Alright, I thought I had this whole setTimeout thing perfect but I seem to be horribly mistaken. I'm using excanvas and javascript to draw a map of my home state, however the drawing procedure chokes the browser. Right now I'm forced to pander to IE6 because I'm in a big organisation, which is probably a large part of the slowness. So ...

Use ModalPopupExtender without having to set TargetControlID?

I'd like to use a modalpopupextender in my asp.net page to show a sub form. But it only has to show on specific conditions. Those conditions are determined in a piece of javascript code. So, most importantly, the modal popup doesn't have to show on a button click. However, if I leave the property TargetControlID empty I get the followin...

How to use CrawlSpider from scrapy to click a link with javascript onclick?

I want scrapy to crawl pages where going to the next one link looks like this: Next Will scrapy be able to interpret javascript code of that? With livehttpheaders extension I found out that clicking Next generates a POST with a really huge piece of "garbage" starting like this: encoded_session_hidden_map=H4sIAAAAAAAAALWZXWwj1RXHJ9n ...