Solved

Best, lightweight and multiple-browser-compatible way to do fancy Javascript dialog boxes (pop-up window replacement)

Posted on 2008-10-19
6
548 Views
Last Modified: 2013-11-11
Hello,

I'd like to implement (at first), two separate things:

- a 'button' that would always be available at a fixed place (even for pages spanning multiple screens) that would call the second thing:
- a 'window' (in fact a superimposed <div>) that would contain two or three text entries and a form. Ideally, this 'window' should be resizable and movable.

I can more or less see how to program it by myself, but if I do so, I believe that I'll have cross-browser problems and that it will be a 'reinventing the wheel' kind of exercise.

I know there are JS libraries (that is why I ask this question in the Jquery subsection also) for doing this kind of things. Are they the best answer to my simple needs? Or does simple 20-lines, rather optimized code to do so, exist?

What matters the most to me is that the library (or snippet of code) is non-bloated, easy to understand and implement (if it is a library, it needs a good documentation), quick to load and, before all, work on all browsers, from IE 5.5 to the latest incarnations of Firefox, Safari and Opera.

If it works well, I'll probably write a complete (although modest) web application using these 'widgets', so it is OK and even desirable that the solution can do a little more than what I asked.

Thanks,
Stéphane
0
Comment
Question by:CPL593H
  • 3
  • 2
6 Comments
 
LVL 10

Expert Comment

by:GeoffSutton
ID: 22753686
Quite simply the easiest approach would be to build this using ASP.NET and the Ajax Control Toolkit.  All you would have to do is worry about making the server side code function correctly, and the client side controls appear as you want them.  The client side scripting is already taken care of for you, and has been tested in multiple implementations on multiple browser types and versions.

You can download the Microsoft Visual Web Developer Express from http://www.microsoft.com/express/vwd/

Geoff
0
 
LVL 10

Expert Comment

by:GeoffSutton
ID: 22753688
oops... And you can get the Ajax Control toolkit through www.asp.net/ajax

Geoff
0
 

Author Comment

by:CPL593H
ID: 22774808
I work with PHP and design on a Mac so asp.net solutions are not an option for this project. Jquery probably looks like a better bet, but I'd rather have information based on first-hand knowledge.

Cheers,
Stéphane
0
The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

 
LVL 10

Expert Comment

by:GeoffSutton
ID: 22777040
Unfortunately I know nothing of JQuery.  My apologies.

Geoff
0
 
LVL 16

Accepted Solution

by:
sh0e earned 250 total points
ID: 22801618
I would highly recommend jQuery.  It has a strong userbase/supporters, very well documented, is compact and fast, liberal license, designed for compatibility, and is even being bundled by Microsoft.
It allows you to write compact code quickly, and is based on selecting elements to do what you want.  It won't protect you from all cross-browser problems, but it'll make your life easier.

There are also people who prefer Prototype/Scriptaculous, MooTools, Yahoo UI, Dojo, ExtJS.  Yahoo UI and Dojo will be a bit heavier, but they are complete frameworks.  Yahoo UI and Dojo are a bit heavier, but it's not much of a overhead.  You load pieces of it when you need it.  Yahoo UI and Dojo are designed with large scale websites in mind.
As many other people will say, you can't go wrong adopting any of these.  Most of them have liberal licenses, and make your life easier.

I find that JQuery is extremely easy to work with.  I literally learned (part of) it overnight.  And, I have never found a problem modifying it not to conflict with other things.
0
 

Author Closing Comment

by:CPL593H
ID: 31507563
Your advice confirms my preliminary tests. Now I'm sure I'm in the right direction. Thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question