javascript

remove element created by javascript on load

How can I remove elements which are created by javascript, I tried using css by setting display:none; but that doesn't seem to solve my problem, also I can't remove them since I don't have them in HTML, any other ways ? thank you UPDATE : Can't use any javascript such as jquery, mootools, extjs etc, and actual elements I want to remove...

How do I resize a div automatically to the size of its contents when the contents of the div have changed?

Hi all, At the moment, I have this DIV with a registration form centered over the page. The contents of the DIV come from an ascx-page. This is done nicely. Now, if the user tries to fill in a name that's not unique, an error message is added by some jQuery next to the username field. This breaks the layout of the DIV, since the content...

Dynamically reassemble a picture in javascript

hi guys, i notice lately that in some websites (i think wired.com does it) the image first load really fast .it always start blurred and get better and finally you have a really hi-resolution picture which is really tiny in size. my question is 1. what is going on????!!! 2. how do i incorporate it into my work? i was thinking it hav...

How do I wait for location.href to finish in JavaScript?

The JavaScript below code has two steps. Step 1: go to .pdf, .doc, .exe or something which not html native. If location.href has took over the browser window then there is no need to do step 2. (PDFs usually take over browser window). Most other things kick off a download manager process. Such as .exe. But there are some things s...

control loaded flash file using php or js

is there a way to write a program in php or javascript that can load a flash file and interact with it? (click on buttons and such) ...

Javascript Event Between onFocus and onChange

I'm working a web page where I'd like to run some Javascript code when a user alters text in a given input field, but I can't figure out which event to trap (assuming one exists) that would give me the behavior I'm looking for. onFocus happens too soon -- if the user selects the field but doesn't change any text, I don't want anything t...

Need help with controlling a page dynamically

Hey guys! I'm looking to make a page wherein a user will make a selection for eg: "How old is your computer?" - "One year", "Two years" etc etc and the page will remove and add 'options' (which at the moment only need to be informative sections of text) Is there any way to do something like that? The technologies I'm using are PHP and...

Calling jQuery Function from Flash

I'm trying to call an external JS function from flash using the ExternalInterface.call() method in action script. The function should open a modal window that has been written in jQuery. My problem is two fold: How do I open this modal window without attaching the action to a link? I just want the window open and to pass in the URL. Is...

Automatic Web Form Submission (looking at Javascript, but other methods are welcome)

What is the most efficient way to do automatic form submission? I'm doing this for fairly legit purposes (well, the site concerned doesn't have an option to send mails to a large group of people, so I'm trying to make my own workaround. But it's not for spamming.) I do remember -- from my days spent playing web-based MMORPGS -- that the...

Ajax Toolkit Client Rendering

Hi all, I'm working on a long, dynamic form (100 or so fields) and am using toolkit items such as CalendarBehaviors, HovermenuBehavior, etc for each field. I've never worked with that many toolkit items at once, and am seeing a big performance hit in rendering. Every instance of a toolkit control is being sent to the client in its' own...

Use recursion instead of EVAL

Hello everybody, I have a list of items in a page that must be hidden in sequence, but just after the previous item has been totally hidden. I made the following code, where I create a big string inserting the callbacks inside the previous callbacks and later use eval to execute the effects, but despite the code is working fine as expe...

Can I use JS encryption instead of SSL for credit card payments?

Hi, I have an HTML form where people can make payments on my sites. Instead of using SSL, I'm wondering whether I could use a JS lib that would encrypt the credit card information and send it to the server in clear text but encrypted, than the server would decrypt it. I found several libs that do that, they basically ask for a key pair ...

JavaScript KeyCode Values are "undefined" in Internet Explorer 8

I'm having trouble with some JavaScript that I've written, but only with Internet Explorer 8. I have no problem executing this on Internet Explorer 7 or earlier or on Mozilla Firefox 3.5 or earlier. It also executes properly when I use compatibility mode on Internet Explorer 8. What I'm doing is overriding the Enter keystroke when a use...

Add JavaScript object to JavaScript object

Hi all, I'd like to have JavaScript objects within another JavaScript object as such: Issues: - {"ID" : "1", "Name" : "Missing Documentation", "Notes" : "Issue1 Notes"} - {"ID" : "2", "Name" : "Software Bug", "Notes" : "Issue2 Notes, blah, blah"} - {"ID" : "2", "Name" : "System Not Ready", "Notes" : "Issue3 Notes, etc"} // etc...

Gradually changing color

How does the logo in the top left corner of the screen gradually change color as a rollover? I think its done in jquery. If you don't know the code can you point me to a tutorial that can? Thanks. http://www.shopdev.co.uk/blog/ UPDATE: Thanks everyone, I've posted a working version of the code below, <html> <head> ...

insert/remove HTML content between div tags

Hello all, how can I insert some HTML code between <div id="mydiv">...</div> using javascript? Ex: <div id="mydiv"><span class="prego">Something</span></div> its about 10 lines of html of most. thank you ...

Is RJS evil and why?

I heard a bunch of rails developer saying that RJS is evil. I've never used it since I always managed to do what I wanted using classic javascript or jquery so I didn't pay attention. Now I'm getting into some legacy code and there's RJS all over the place. So... is it true? What are the drawbacks/advantages of using RJS? ...

Showing/Hiding a DIV based on one or more checkbox/radiobox selections?

I asked a similar question previously, but it was so vague that I couldn't possibly have gotten the answer I wanted. Basically, I want a user to be able to select from multiple options and have various bits of information appear based on the selections. For example: "How old is your computer?" Options: [x]One Year [ ] Two Years [ ] ...

Views in Ruby on Rails, enabling submit_tag with javascript

I have an html.erb file which includes the following <%= submit_tag "Locate", :disabled => true %> I also have <%= text_field_tag 'locationPOS', "", :disabled => true %> which has its value updated when the user click on the google map present on the page (from a separate javascript file) by locpos.value = place.address; I would li...

Parsing XFN data with Jquery

I'm trying to filter the XFN relationships meta data found in web pages. It is something like this: <a href="site" rel="friend colleague" >Name</a> in REL you can have various values, like "friend", "collegue" but even "me" and "met" because you can have multiple values, I did this: xfn_me = $("a[rel*=me]").length; But this doesn...