javascript

Wondering if this code excerpt can represent a event listener...

Can we call this: $('#nomeInput').keypress(function(){ //code here... an event listener? Thanks. ...

onkeydown crossbrowser on IFRAME?

Hello, before to post i try to search a solution in this site and by google but with now luck. I have a issue with IE8, this code below add on the fly an IFRAME and work fine in Chrome, Firefox and IE7. The problem is the keyHandler() function that is not triggered only in IE8. What is the best solution to attach an event crossbrowser...

Google Maps add Location

How can I get the location that the user has clicked on the map via js? ...

What exactly does this javascript getElementsByTagName syntax do?

I have this: var targetTitle = targetElement.getElementsByTagName('title').item(0); Am i passing a plain string into targetTitle? or what am i passing exactly? Which element would be item(1), item(2), etc... in here: <title>title1</title> <title><title2</title> Does it just look for ALL the title tags on the page and return the 0,...

Serialize form to and from JSON

I want to serialize a form into json, process the json object, then reserialize it to send to a php script via ajax. Here is a rough example of what I want to do: s = $('.dia_req_form').serialize(); j = //convert s to json ...HOW?? if(j.name) { alert("you must enter a name"); } if(selectedID) { j.id = selectedID; } s = //serial...

svg tutorials that show how to do mouseover

a. i have a huge SVG file 2. i have objects in the SVG file that look like this: <path style="fill:#f7d3aa;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" d="M 923.03026,37.975518 C 922.57184,38.995849 921.76084,41.697403 921.76084,44.352463 C 921.76084...

What is window.eventReturnValue?

I came across window.eventReturnValue on a couple of web pages today (see the second-to-last line of third yellow box in this example). It's not something I'd ever seen it before. What browsers use it? EDIT: Thanks to Tim Down for pointing out that I was misreading a typo on the linked example. ...

Why won't my playlist work?

Cross-posted on the Flowplayer forums, but no response there yet, so I hope someone here could help. I'm having no success at all using the Playlist plugin. I've followed the examples at http://flowplayer.org/plugins/javascript/playlist.html closely, and I get the initial clip to work, but the Playlist plugin does not seem to register. ...

determining if a field exists on a form

I have a form field (a series of checkboxes) that's being created dynamically from a database, so it's possible that the field will not exist on the form (if there are no matching values in the database). I have some code that needs to execute based on whether the field exists, and pull in the values that are selected if it does exist. I...

Guidlines and best practices to make a proxy-friendly site

This is a question to proxy and plugin developers. The usual mindset when it comes to specific sites is "They make changes which breaks our plugin; we change the logic to make it work again". But, what if the other side worries about this too? If we want to compile a set of guidelines and best practices for site development for a proxy...

AnythingSlider with fade effect

Hi! I'm using the anythingSlider by Chris Coyier. Can anyone tell how to change from slide effect to fade effect? Regrets, Saulo ...

JavaScript/jQuery: Keypress for keyboard navigation (event.which doesn't work)

When handling key[Up|Down|Press] events, should I use .which or .keyCode? Can I have some example code for handling the three keyboard events in jQuery? Can you do it without jQuery? I want it to work reliably in every browser. Update Strangely, jQuery's event.which normalization wasn't working for my handleKeyPress(event) handler: //...

Cross-browser event handling

I need a cross-browser function for registering event handlers and a (mostly) consistent handler experience. I don't need the full weight or functionality of a library such as jQuery, so I've written my own. I believe I've accomplished my goals with the code below, and so far my testing has been successful, but I've been staring at it fo...

how to use mvcArray on google maps v3

i can use the methods like : push removeAt setAt but how to use the Events ? like: insert_at remove_at thanks ...

How do I put linebreaks in tooltips?

i am using this tutorial to add tooltips to my svg: http://flowplayer.org/tools/demos/tooltip/index.html here is a sample of my svg: <path d="M 747.96137,581.40584 L 749.98034,589.3338 L 753.58521,598.75 L 758.74146,607.8125 L 762.33521,613.90625 L 767.02271,619.21875 L 770.92896,622.8125 L 772.49146,625.625 L 771.39771,626.87...

How to remove part of a string?

Let’s say I have test_23 and I want to remove test_. How do I do that? The prefix before _ can change. ...

Notification bar to web page similar to the SO

How do I write a notification bar in JavaScript similar to the one that you see on Stack Overflow? In my project they are asking for one just the same as this website I wrote the code for this for this but I am not getting the exact one ., I want to know about the cookie logic and vertical slidiing and fadeout and any modifications in...

.each() > $(this).find().eq().html() is null

Why don't work? var str; $('table tr').each(function() { str = $(this).find('td').eq(6).html().trim().substring(10, 20); $(this).find('td').eq(6).text(str); }); Need write in all 6th trim+substring+another_string_action with same value. Firebug write error: $(this).find("td").eq(6).html() is null ...

Positive look behind in JavaScript regular expression

I've a document from which I need to extract some data. Document contain strings like these Text:"How secure is my information?" I need to extract text which is in double quotes after the literal Text: How secure is my information? How do I do this with regex in Javascript ...

is there anything in javascript that can convert "August" to 8 ?

i need to convert Monthname to integer of that month (and want to avoid a big switch statement). any ideas? ...