javascript

Can't find flowed text element by ID in SVG

I've been playing with animation in an SVG: http://imgh.us/renamon-animtest.svg (links to script "anim.js") In the window.onload event, I have: function init(evt) { if(window.svgDocument == null) { if(evt.target && evt.target.ownerDocument) svgDocument = evt.target.ownerDocument; else if(evt.original...

Am I missing something? My values don't get stored into my array

Hi I have this var selected = [] $('#SelectBoxContainer .DDLs :selected').each(function (i, selected) { alert($(selected).val()); selected[i] = $(selected).val(); }); My alert is telling me that it is going through this loop and getting the select box values. Yet once everything is sai...

Finding sub properties of javascript object

My code ise this: var cem = { "name": "cem topkaya" }; f_PropertyBul(cem); function f_PropertyBul(obj) { for (var prop in obj) { document.writeln(obj + " prop: " + prop + " propertyIsEnumerable:" + obj.propertyIsEnumerable(prop) + "<br/>"); if (obj.propertyIsEnumerable(prop)) { f_PropertyBu...

Why is this jquery in visualforce not working?

This code is in visualforce (salesforce's page editor language). Basically the apex:repeat tags function as a sort of loop, generating a set of urls from outputlink. All these urls have a class of "name". What the jquery is to do is find all the urls with the class name, and click them so they open in new windows. Its not working. <ape...

Javascript regex help

Does anybody know how I can make the forwardslash and format: dd/mm/yyyy compulsory in this regex? // Checks a string to see if it in a valid date format // of (D)D/(M)M/(YY)YY and returns true/false function isValidDate(s) { // format D(D)/M(M)/(YY)YY var dateFormat = /^\d{1,4}[\.|\/|-]\d{1,2}[\.|\/|-]\d{1,4}$/; if (dateF...

Javascript document.write in IE 8

This is doing my head in, been chasing it all day. We have an ad server that calls a script on our site which then inserts code. E.g. Adserver page called in an iframe: <html> <head><title></title></head> <body> <script src="http://adserver/ad?s=728x90"&gt;&lt;/script&gt; </body> </html> The javascript returned by the script call ab...

insert javascript into page

Hi, Im using internet explorer as the default browser. (Firefox is not an option). There are some web apps that I like but whose layout and workflow does not quite agree with me. Given that I am merely a visitor to the website, is it possible to insert jquery into the webpages Im browsing so that I can re-arrange the web content and call...

HTML5 localStorage with a textarea

I've been trying to use localStorage with a textarea in my webpage (to no avail). My save script is as follows: $(function() { var editor = document.querySelector("#editor"); editor.addEventListener("keyup", function() { window.localStorage["TextEditorData"] = editor.value; }); }); My load script is as follows: $window.load(fun...

javascript/jquery - $(document).ready() and script locations

I'd like to know how $(document).ready() works, along with scripts in general. Say I have scripts that are at the bottom of the page (for performance reasons I'm told?). As an example: say you have a link and you need to prevent it's default action (preventDefault()). If the script is at the bottom of the page, isn't it possible that the...

callback function return global object :/

Please help with my problem described below: var Land = function(){ this.cities = []; } Land.prototype = { addCity : function(city){ this.cities.push(city); } } var City = function(){ this.val = "foo"; }; City.prototype = { test : function(){ this.val = "bar"; console.log(this); } } var ...

How do I use jQuery in google code's wiki

I have a jQuery plugin up on google code http://code.google.com/p/jquery-html5upload/. I want to have a running example of the plugin on the project home page. How can I go about doing this? I can't figure out to include/use javascript in the wiki pages. Any help would be greatly appreciated. ...

check if username/email is already exist using javascript

hi there, i have a simple question. how can i check if the username or email they entered is already exist.. i have this code, if(document.RegForm.user.value =="") { alert("User Name Please?"); valid=false; } that's my code for username, i don't know what code i will add to check if user name ...

<%= %> embedded in Javascript IF Condition

In aspx page: if (<%= Not Me.ThisVisa.PassportExpirationDate.IsNull %>){ Returns error: Microsoft JScript runtime error: 'True' is undefined I tried this: if ("<%= Me.ThisVisa.PassportExpirationDate.IsNull.ToString %>" != "True"){ ..but I get a compile time error: Error 5 Option Strict On disallows implicit conversions...

Firebug console shortening strings in array logged?

Hello all! I have a custom logging function to log to the firebug console that looks like this: // the name here is just for fun function ninjaConsoleLog() { var slicer = Array.prototype.slice; var args = slicer.call(arguments); console.log(args); } And it works exactly like I want it to....except that if I have string v...

jQuery foo.html("<span>bar</span>") not changing foo[0], so what does it mean?

Using jQuery, in Firebug, if the following is done one by one: foo = $('<div>foo</div>') foo[0] // => <div> foo.html('<span>bar</span>') foo.html() // => "<span>bar</span>" foo[0] // => <div> $('body').prepend(foo) // => shows bar at top of page it is strange that foo.html() shows the span, but foo[0] shows the div... why is ...

jQuery modal dialog using loading a form page that already contain jQuery code (Autocomplete) content?

I have a form in a web page dynamically generated and I would like to display it using a the jQuery UI modal dialog. The solution I was proposed in a previous post works when my form does not embedded jQuery UI itself : jQuery UI modal dialog form using remote content. The way the remote form already contains jQuery functions : Autoco...

how can I make a slide show repeat

Hi dear everyone, I set up a slideshow for my webpage with the following script, but can't find it out how can I make it repeat. I mean I want when it go to the last photo, it will repeat to the first one again. Any one can help please: open this link and view the code source please: http://www.xuanyinwen.com/test2.html Many thanks Wa...

Restricting characters entered in textbox using Javascript

I need to validate a textbox that it should allow only certain characters and after the limit is reached the textbox should not allow entering characters in it.It can be done by Javascript but dont know how to do.. Anyone please help.. ...

Don't run Javascript function until custom font downloaded?

Is there a way to not run a Javascript function until after a custom css font resource is downloaded. I am displaying code in a <pre> and using the custom downloaded font Liberation Mono. The <pre> is also using custom scrollbars. The custom scrollbars Javascript (flexcroll) needs a static width set when setting up. But I can't know ...

How do I create json file from plist file?

I want to create a json file from from exsited plist file. How do I create json file from plist file using programg language (Javascript or Java or Objectiv-c or Python or Ruby)? ...