javascript

Frameworks And 'traditional' coding

Hello Sorry if this too open ended for this forum, but here goes. I mostly use languages such as PHP and Javascript without frameworks (e.g Jquery, Drupal, CakePHP). The only real exception to this for me, is Wordpress when 'traditional' coding is slower for building information sites. I've dabbled with several frameworks over the past...

Show or hide elements in PDF via Javascript

In PDF files it is quite easy to interact with form fields via the Javascript API. Is it possible to do this (specifically showing/hiding) to arbitrary elements on a page? Say, not just form fields, but text, graphical elements, embedded images... Is there an API to interact with those? If yes, how do I identify an object? ...

Google Website Optimizer - Multi Variant Testing - Make a specific page a test page for two experiments?

Im having a little issue with setting up Multi Variant Tests in Google Website Optimizer. I wish to have two tests. One being which is a header banner which appears on every page and the conversion for example would be if the visitor lands on the contact us page. This was very easy to set up. However when I intend to add another test, ...

Regular expression for email

Possible Duplicate: What is the best regular expression for validating email addresses? I tried the reg expression ^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+ for the email validation. Since I want the user to allow submitting even with the empty email address. So I changed the reg ex to (^([a-zA-Z0-9_.-]...

ContentFlow: avoid image-overlapping

Hello! I'm using ContentFlow (http://www.jacksasylum.eu/ContentFlow/index.php) and I would like to avoid image-overlapping adding 20px more on both left and right sides. Could you tell me how to implement it? Many thanks! Corrado. ...

document.elementFromPoint(x,y); not working

Hi i am using document.elementFromPoint(x,y); function to find out the underlying element on the mouse click. It is working fine when i open the corresponding html file with firefox. But i have written an application using gtkmozembed to open html files. When i open html file with my application and clicked on the page it is giving ...

asp.net-mvc: javascript caching

I'm thinking whether it makes sense in order to increase the speed of the website to do some strategy of caching the js files that are being included ? one idea that I have is to do something like this: [OutputCache(Location = OutputCacheLocation.Any, Duration = 3600)] public JsController : Controller public ActionResult JQuery() { //I...

How to fire/invoke event when checked status is altered with javascript ?

I need to fire the change event when other javascript function changes the checked status. Simplified code below. I can not call MyFunc() from MyOtherFunc(). jQuery: $(document).ready(function(){ $('input:radio[name=rdName]').change(function(){ MyFunc(); }); }); function MyFunc(){ //do stuff } function MyOtherFunc(){ $('inp...

Call javascript function from asp.net code behind after server side code executes

I have an asp.net button, that when clicked calls a code behind function. The function does some evaluation, and then I want to call javascript from within this asp.net function. ...

Do we still need backup code for people who have javascript disabled?

I hear about it a bit in tutorials that I watch, that certain things won't work if javascript is disabled. Occasionally I see workarounds. The question is, are these relevent? I can't imagine anyone not having a javascript enabled browser nowadays, except the most ancient of phones, and chances are your page won't render on them properl...

Read cookies with JavaScript

I know how to write/create cookies in JavaScript......................................................... //Create the cookies document.cookie = "Name=" + Name + ";expires=Friday, 31-Dec-2011 12:00:00 GMT; path=/"; document.cookie = "Surname=" + Surname + ";expires=Friday, 31-Dec-2011 12:00:00 GMT; path=/"; document.cookie = "Number=" +...

set tab in new window using window.open

Hi All, I have two pages name one.php and two.php in one.php i have a combo box which has a option values like option value='0' option value='1' option value='2' option value ='3' Now when on change event of combo box fires i am opening one new window named 'two' as follows $('#sel').live('change',function(){ var tindex=$(t...

Malware on a client's website - Ideas?

We recently got a call from one of our clients, complaining that their site has some "strange looking code" at the bottom of the page. We checked out the source code, and discovered that about 800 bytes of malicious javascript code had been appended to the templates/master file, after the </html> tag. I won't post said code because it lo...

the way to get a value from a hidden type correctly

in a html table i construct in each row an edit button like the following: retour.append("<input type=\"hidden\" id=\"id_"+nomTab+"_"+compteur+"\" value=\""+object.getIdDailyTimeSheet()+"\" name=\"hd_"+compteur+"\" />"); this is the hidden type then i do the following: retour.append("<button id=edit name=edit type=button onClick...

JavaScript Music Player with progress bar?

I am creating a little JavaScript music player that sits on the btottom of the page, a lot like streampad. But streampad uses a flash progress bar for the song and JavaScript for everything else and I am having a hard time finding anyone who does this with JavaScript alone. Can anyone point me in the right direction on how this can be ...

handling javaScript alerts when running a selenium test?

Hi I am am running some selenium tests(ruby) on my web page and as i enter an invalid characters in to a text box i have the JavaScript throw a alert like so if(isNaN($(this).val()) || Number($(this).val().valueOf() <=0)){ alert("Please Enter A Number"); } how can i handle this alert when its made and close the pop up? i tried ...

Jquery Asp.net button disable

Hi all; html code: <asp:Button runat="server" ID="btnTest" Text="Test" OnClick="btnTest_Click" /> Jquery Code: $('[id$=btnTest]').click(function(){ $('[id$=btnTest]').attr('disabled', 'true'); }); CodeBehind: protected void btnTest_Click(object sender, EventArgs e) { //here not come. } Code Behind btnTest event not work ? ...

Servlet container; What is it and do I need it in my case?

I have just ordered a VPS from my provider. I have some Q however... My website uses Solr, which requires the following according to their website: "Solr requires Java 1.5 and an Application server (such as Tomcat) which supports the Servlet 2.4 standard" I also need php 5, MySql, and the usual javascript etc... The OS is Ubuntu 9.10...

javascript - how to control if /else if / else

How to control to which if the else is correlated? ex: if X = 1 { // A if Y > 1 { // B gothere(); } } else if X < 1 { // C gohere(); } else { // D gonowhere(); } how to make sure C and D will not be related to B??? here´s another example: if xxx { ... FM_log(7,"vList.length = "+vList.length); if (skippin...

How do I move the cursor from the first textarea to a second textarea, without using tab or the mouse ?

I'm building a password box that holds three text areas. Each text area has one character. After I type the first character of the password, I have to press tab or use the mouse to get to the second text area to type the second character of the password. I would like to make this happen automatically (cursor movement) just right after I ...