javascript

Change the get parameters in the address bar in jquery

when you search on yelp, by adding additional search parameters the page does not reload. I think the results are changed based on ajax, however when you click on one of the restaruants and go back to the previous page. All of the parameters are still there. I noticed the address bars change as the parameters change. I found http://www....

How to get the value of radio buttons via Jquery

If I have the following radios: <input name="color" id="color_blue" value="blue">Blue <input name="color" id="color_red" value="red">Red <input name="color" id="color_green" value="blue">Green What's the easiest way to find out which radio the user selected? Preferably something like to: $("color").val(); Or something close to that...

jQuery .click handler not working in Safari

I have jQuery .click(function() event handlers attached to elements that I've selected by ID example: $('#deletethis').click(function() { $(this).hide() } within my $(document).ready but this does not work at all with Safari, just nothing happens but it works fine with Chrome, Firefox, and IE. Console reports no javascript erro...

show and then hide text JS Jquery

Hi. I want to do so when you just entered index.php it will appear a text for 10 seconds, and then it will hide, how to do so? and hide like slowly fine i have jquery ...

PHP work with JS Jquery

Hello. How do i make PHP work with JS? I mean more like, i want to check if the user is logged in or not, and if he is then it will: $("#message").fadeIn("slow"); .. How should i do this? I have an idea maybe have a file that checks it in php, and then it echo out 1 or 0. And then a script that checks if its getting 1 then do the me...

javascript php array

i have a js array like this: var myArray = []; myArray[1] = 'test'; myArray[2] = 'test'; -i want to hide it from users to see it. how can i store just the array in a php script and call it? right now i have the .js separate from my form. and i just call it. but anyone can easily view source and visit the url using the .js name -ano...

Simple JavaScript/jQuery plug-in that 'quicklooks' images.

Is there any good JavaScript/jQuery plug-in that will 'quicklook' an image on click? I want it simple so when you click the image thumbnail it just zooms out to full size. Ideally it would be set up by just giving said image a class and the JavaScript/jQuery does the rest. Similar to the some on the images on this page of Apple.com, s...

Vertical positioning (stacking) of elements incorrect in IE

Hello. I have this simple: <script type="text/javascript"> $("#message").fadeIn("slow"); </script> <div id='message' style="display: none;"> <span>Hey, du har fået +1 points, du har nu <u>2929</u></span> <a href="#" class="close-notify" onclick="closeNotice()">X</a> </div> And i have a design on my site. When i use this, it w...

Change number of HTML Input fields with Javascript

Hello. I'm working on an HTML form that will post data to my Webserver for storing into a database. I have no problem with the PHP and SQL code, but I want to have a small feature on the client side form: There is to be a dropdown (select) that asks how many rows of a certain type you want. Then, a small JavaScript should produce these...

Converting a string to a JavaScript object - is there a safer way than to use eval?

I'd ideally like to create a streamlined interface which requires the user to select one of three radio buttons such as shown here: <form id="icon-type"> <input type="radio" name="icon" value="apples" /> Apples <input type="radio" name="icon" value="oranges" /> Oranges <input type="radio" name="icon" value="graphes" /> Grape...

How do get the x&y corrdinates from an image input?

I have an input set to a type of image: <form id="MapForm" action="#"> <input type="image" src="usa.jpg" id="usa_map" alt="USA"/> </form> I want to attach a function so that I can get the X & Y coordinates where a person clicked: $('#MapForm').submit(ClickOnMap); function ClickOnMap(data) { return false; } I cannot find the...

JS/php add for every minute.

Hello. What i want to do is that every user gets 1 points every minute. Now i have the php code in the addpoints.php, and then i have tried myself with jQuery javascript: function addpoints() { var userid = document.getElementById('user_id_points'); var postFile = 'addpoints.php?userid='+ userid.value; $.post(postFile, function(...

Button Style has thick border on page load when multiple buttons are on a page.

Hello, this is my first question asked here a stack overflow. I have a problem that has been bugging me for a bit now. When I have a page loaded with multiple buttons on the page the first button in the HTML Markup seems to get this think border around the button. I'm sorry if this has been asked before but I've read many forums that ...

Convert client time to utc time to save into sql

How could I go about having a client in various time zones select a date and time in their web browser and save it as utc time in my sql database? This date is a date in the future, so whether or not the date is in daylight savings time could change so I'll need to account for that. The site is a asp.net c# site. ...

How does twitter live-update your timeline?

Hello guys, Thanks for reading. We are developing a web app. and we're finding out how to live-update some counters and info in the client side, without use scheduled-Json-Updates (yes, timeouts works... but there should be another way ; ) So I was looking at Twitter... they live-update our timeline don't they? I cannot see the timel...

Locate an element within SVG in Opera by coordinates

Hi, How do I locate an element within SVG in Opera, given coordinates? elementFromPoint(x,y) works fine with Firefox, but seems to fail with Opera, returning always the whole SVG and not the particular element. One might wonder why do I need it at all. Well, simply because I'd like to highlight the SVG element under the cursor, and be...

HTML/JS/CSS Isometric Grid with semi-transparent click-through tiles

Hi. I'm trying to create a web app/game that uses a side-on 'isometric' view and transparent tiles. I can display them ok (but not great) using a PHP formula that just sets each div (each tile) as position:absolute and set the top and left parameters. The problem is how do I catch clicks on a tile and let tiles with transparent bits clic...

JavaScript FF IE Update + message script issue

Hello. I have this ajax_update script that updates file.php every 60 seconds.. Now file.php outputs this after updated a table: <div id='message' style="display: none;"> <span>Hey, <b><? echo $userid; ?></b>, You've got +1 points, you now have <u> <? echo $n["points"]; ?></u></span> <a href="#" class="close-notify" onclick=...

how to get the arrow keys on the keyboard to trigger navigation (previous/next page) links within a blog

the script i've pieced together so far looks like this: <script type="text/javascript"> /* KEYNAV */ document.onkeydown = function(e) { if (! e) var e = window.event; var code = e.charCode ? e.charCode : e.keyCode; if (! e.shiftKey && ! e.ctrlKey && ! e.altKey && ! e.metaKey) { if (code == Event.KEY_LEFT) { if ($('previous_page_link')) ...

what does this refer to in a javscript private method

Using the following bit of code: function Node(){ .... function foo(request){ for (var name in this ) { log(name +" is "+this[name]); if(!(name == 'all' || typeof this[name] == 'function')){ request[name] = this[name]; } } return ... }; } I was surprise...