javascript

What is best lightweight unobtrusive solution to open any link in custom size popup?

What is best lightweight unobtrusive solution to open any link in custom size popup with "close" button? Edit 3: and if JavaScript is disabled then link should be open in new tab/window like any any normal page. popup should be open vertically and horizontally center on any screen resolution ( i've notices pop-up of some siteson net o...

What is the difference between Popup , chromeless window, modal-window, lightbox, hover ad?

What is the difference between Popup , chromeless window, modal-window, lightbox, hover ad? Which is unblockable with default setting on any browser, more accessible with screen reader and even accessible if javascript disabled? ...

jQuery - expand/collapse all button, Internet Explorer problems

I have a custom tree structure type display. I have Expand all and Collapse all buttons, which are hooked up with the following simple jQuery. $('#expandAll').click(function() { $("img[src='images/plus.gif']").parent().click(); }); $('#collapseAll').click(function() { $("img[src='images/mi...

Why does any social site like Reddit use this method?

See what Reddit uses to add one of its buttons: <script type="text/javascript" src="http://www.reddit.com/button.js?t=2"&gt;&lt;/script&gt; This JavaScript adds an <iframe> to the page, then the <iframe> adds the HTML code. Why doesn’t the JavaScript add the HTML directly? ...

Objects's global variable

The problem is with object's variable: this.timer it's not "global", so when I click the stop button the value of the variable is wrong. If I declare a global variable MyObject (loke var mytimer;) and use it instead this.timer, it works. This is my code: <html> <head> <meta http-equiv="content-type" content="text/ht...

addClass if contains match

HTML: <li class="widgetcontainer widget_text" id="text-3"> <h3 class="widgettitle">Static Ad</h3> <div class="textwidget"><img alt="" src="static/announcement.png"></div> </li> jQuery: if( $('.widget_text')[0] ) { $('.widgettitle').each(function() { if ( $(this).containts('Static Ad') ) { $(this).parent().addC...

jQuery ajax and javascript objects

Hello, i've used prototype before, and i'm trying to learn jquery now. The problem: I have an object that makes an ajax call, and i want the success callback to call a function within my object. The problem is that inside the callback function, "this" does not point to my original class. Example: function C(){ this.loadData(); } C....

how create a session using javascript?

hi, how to create session in javascript? i try like this <script type="text/javascript" > { Session["controlID"] ="This is my session"; } </script> hoping your support Alex ...

How to make this bookmarklet work on Safari?

Hello, I am trying to make a bookmarklet test. Below code works on FireFox but couldn't on Safari 4.0.3. Does anybody know how to make it work on Safari? javascript:var s = document.createElement("script"); s.text = "document.write('hello');"; s.type = "text/javascript"; document.body.appendChild(s); ...

How can I run an appear effect and a fade effect in scriptaculous? I need them to run in tandam so that no other effect can slot inbetween...

Hi, Ive been fiddling with this for hours and hours and just cant get it right. First off my sites are already using Prototytpe and Scriptaculous, and to change would take a long time. Basically I am after achieving a slideshow effect similar to jQuery Cycle plugin. I have written most of it but cant get over this hurdle: I need the u...

Email Div Content

I am trying to email the content of a Div. We have a booking system online and the user selects what options they want, then submit the form. It displays their information on the next page for them to print. I also want a copy of that emailed to them and us. I liked the look of Jonathon Sampson's email div using ajax script. But it does...

What kind of architecture is good for my JavaScript software?

Hi, I am writing a software for a website where people can manage the website content. The interface is similar to Windows with all those windows floating around, click-able components, type-able text fields, etc. The admin interface is written in JavaScript, HTML and CSS. I'm wondering what kind of architecture should I apply to my adm...

C# httpwebrequest on javascript

As some of you may know, you are able to POST with C#. This means you can "push" buttons on a website with webrequest/response. Now there are also buttons on sites which work with javascript, they start like: (function($j){ $j.data(document, 'maxPictureSize', 764327); share_init(); })(jQuery.noConflict()); Is there any solution you c...

How to display all methods in a JavaScript object?

I wanted a way in which I could get all methods available in a Javascript Object like following alert( show_all_methods( Math ) ); should alert abs, acos, asin, atan, atan2, ceil, cos, exp, floor, log, max, min, pow, random,round, sin, sqrt, tan. ...

Where to learn how JavaScript based inheritance works?

Hi, I'm trying to write a software in JavaScript, but I'm having hard time trying to get the idea of all this prototype and other wicked looking inheritance stuff. What I would like to know are the different ways to get inheritance, and the pros and cons of each. ...

Call function of included JavaScript code from another included JavaScript

Hi, I'm trying to work with different loaded JavaScript in my page, but I'm not able to let them talk. <html> <script type="text/javascript" src="jquery144.js"></script> <script type="text/javascript" src="shared_functions.js"></script> <script type="text/javascript" src="page_function_callers.js"></script> </html> // shared_functions...

Convert European time format to USA

How can I convert European format date to USA in JavaScript? Here is an example: 30.01.2010 -> European 2010-01-30 -> USA Meaning convert d.m.Y to Y-m-d. I know how to do this in PHP but I need it in JavaScript. ...

how to download local network file via browser

Hello exprts I want to give a link of network local file in browser, where users can open from there. link would be like this file.xls In IE6,7,8 it doesn't work. Any idea ? ...

Jquery Rollovers, issue with click state

Excuse my noobiness when it comes to Jquery, but I have some jquery code that does rollovers for me: $("img.rollover").hover(function () { this.src = this.src.replace("_off","_on"); }, function () { this.src = this.src.replace("_on","_off"); }); Essentially just switching the images from image_on.jpg to image_off.jpg on h...

Problem using the JPlayer audio player.

I'm trying to use the JPlayer (http://www.happyworm.com/jquery/jplayer/) jQuery plugin and having some trouble using it when it falls back to the Flash SWF. In that case I hit an error m.fl_play_mp3 is undefined which I've traced back to possibly a problem with the path to the SWF file. However, I've put the full path to the SWF direct...