javascript

Update data into mysql database by clicking on a link

I there a way to update data into mysql database when click on a link? I want create a comment voting system on my site so when user clicks on a "Vote for this comment" link, +1 should be sent into database... How is that possible? ...

how to open the url in Internet Explorer in a new window

when i click on button1 it should open the url in Internet Explorer in a new window... thanks in advance , - Miss Subanki ...

How to know if raphael object is hidden?

I am creating a diagram application in which I hide and show few elements e.g. var c = paper.circle(10, 10, 10); c.hide() var c2 = paper.circle(10, 10, 10); c2.show() Now I want to act upon such shapes e.g. calculate bounding box etc but I am not able to find how to get if shape is hidden or not? Is there something like this shape.is...

Implementing Conway's Game of Life in JavaScript with <canvas>

I've got some problems implementing Conway's Game of Life in JavaScript. At the German Wikipedia it says that this pattern here: Will create an empty world after 54 generations and the evolution looks like this: That means, the second generation looks like this: But when using my code, the second generation looks like this and t...

Opening the window in new IE window when you have a function like this one

Refining my question little bit this time. :D I have this function, but instead of opening it in the parent window, I want it to open in a new IE window... and oh "_blank" is not working for me . function saved() { str = parent.a.document.abc.text.value; SER= top.document.open(); SER.write(str); SER.execCommand(); SER.close(...

Fast dynamic JavaScript WYSIWYG editor

Right now I am using the TinyMCE wysiwyg editor within my projects. However there are some disadvantages with tinyMCE: Tons of GET requests Big It is slow. I can't have a large number of TinyMCE editors at the same time. (Especially in IE) Changing the DOM position of the TinyMCE caused issues where the listeners got lost. Complicate...

Check that your page is not requested via ajax?

Hi guys, I have some pages set up so that they respond only to ajax requests. The thing is that how can I set it up so that if someone tries to send the requests via a browser window i.e by typing them out - they don't run and that they run only when an ajax call is made. The pages are in php here ...

Is that possible to display image thumbnail without uploading it to the server ?

I want let user to upload images to server add some info (like description, tags) about each image.I use Uploadify to upload multiple images. I wonder if it is possible to show thumbnails of the images (while the user enters the additional info about each image) before the images are actually uploaded to the server. I want user to have...

How to submit a form WITHOUT clicking a submit button?

I want the form to be submitted when the user chooses one of the radio button options. I know how to do this with select fields: <select name='something' onchange="this.form.submit()"> But how to do this with radio buttons? ...

a better way to check if a checkbox is defined?

hi there, currently i am using var email, fax, sms = false; if($('#uemail:checked').val() != undefined) email = true; if($('#ufax:checked').val() != undefined) fax = true; if($('#usms:checked').val() != undefined) sms = true; but its such a long way to write it. is there a better wa...

how to prevent form from sending some fields we don't want to send?

hi, i have form that have about 5 fields which final query created by processing values that fields. i want to send only final query not all fields to server. can i exclude some fields from submitting (with jquery)? <form action="abc/def.aspx" method="get"> <input type="text" name="field1" /> <input type="text" name="field2" /> ...

Is there anything wrong with this statement? (Javascript)

Hi, I would like to know if there is anything wrong with the below statement. document.getElementById(monthId).options[document.getElementById(monthId).selectedIndex].value Am asking this because, sometimes it seems to work fine and the rest of the time, it throws up an error - Object doesn't support this property or method. BTW, mo...

How do I pass the this element to the result of getJSON?

I want to do the following... $('.showcomments').click(function() { $(this).parent().hide(); jQuery.getJSON('comments.json',function($data) { $(this).parent().append($data['value']) //this is meant to be the instance of //$('.showcomments') that has be...

Change CSS of selected text using Javascript

I'm trying to make a javascript bookmarklet that will act as a highlighter, changing the background of selected text on a webpage to yellow when the bookmarklet is pressed. I'm using the following code to get the selected text, and it works fine, returning the correct string function getSelText() { var SelText = ''; if (window.getSelec...

Javascript indentation in VIM

I'm trying to get VIM to indent Javascript with the '=' and related commands. When I try to auto indent the following, for example: new function($) { $.fn.setCursorPosition = function(pos) { if ($(this).setSelectionRange) { $(this).setSelectionRange(pos, pos); } else if ($(this).createTextRange) { ...

Creating a scroll down form using java - is this the code?

Hi everyone, I am trying to understand the code (if this is even the code) which comes from thisnext.com website. Basically it allows any user surfing any website to post recommendations. Im interested to know what does the codes mean. javascript:(function() { var x=document.getElementsByTagName('head').item(0); var so=document.cre...

fullcalendar, how to call month method?

Hello, I'm using fullcalendar. And i want to change my calendar, so the default month is June (the initial month for loading), I believe this is what I need: http://arshaw.com/fullcalendar/docs/current_date/month/ The problem is, I'm not very good at .js... and the explanation isn't very clear. This is what i tried: <script type='te...

Intercept "location.href" in a UIWebView, Objective-C

What is the correct code to intercept location.href URL in a UIWebView? - (NSString*)actionURL { NSString *script = @"document.getElementById('action_url').name"; return [webView stringByEvaluatingJavaScriptFromString:script]; } This code doesn't work :( ...

how to send table value to printer ?

I want to send table values to printer.That table contails more than 50 records.so there is scrollbar or pagination on that table.Below the printer there print button, if click the button those all values should go to printer. function print(){ window.print(); window.opener.document.location = window.opener.document.location.href; wind...

onHashChange running onLoad... awkward.

So I'd like my page to load content if a window's hash has changed. Using Mootools, this is pretty easy: $extend(Element.NativeEvents, { hashchange: 1 }); and then: window.addEvent('hashchange', function() {}); However, the hashchange event is firing when the page is being loaded, even though the specification require it not t...