mooeypoo Posted January 10, 2008 Posted January 10, 2008 Well, I ventured into AJAX, had some fun with it, managed to build a registration system that validates fields in their prospective <div> tags and it worked like a charm.... ...In Firefox only. I did some digging and I found out that there is another way to do things with Internet Explorer, but I couldn't manage to integrate them into my existing code. Anyone has any idea how I can automatically detect a browser and use the proper form for AJAX in IE ? Thanks! ========= CORRECTION ========= I just re-checked, and it works great in *my* internet explorer, but not at work. I assume it's because my workplace blocked ActiveX from loading (I don't even get the bar when I use it. So the problem is not all-IE but rather IE that has ActiveX blocked. Any solutions? ~moo
insane_alien Posted January 10, 2008 Posted January 10, 2008 don't use activeX? most people have it switched off for security reasons.
Pangloss Posted January 10, 2008 Posted January 10, 2008 I think you may be barking up the wrong tree there. As I understand it, ActiveX controls are full-blown applets under the Windows API. You shouldn't need them just to play around with AJAX. Form field validation should be easily accomplished with standard Javascript. I think I have an example of a fancy client-side validator here somewhere... Yes, here we go: http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ValidatorCallout/ValidatorCallout.aspx That's part of an open source project called the AJAX Control Toolkit and the source code can be downloaded from the project's home page here: http://www.codeplex.com/AtlasControlToolkit (Atlas is what they used to call it back in Beta.) I don't know how you would go about making that compatible with all browsers (maybe it is by default, try it). But there's a very active discussion amongst ASP developers on the forums here: http://forums.asp.net/ BTW, the site may prompt you to install Silverlight. You can cancel that request -- it won't stop you from viewing any content, including the AJAX sample I linked above. I think it's dumb that the site does that but what do I know. (Silverlight is Microsoft's attempt to take on Flash. Competition is a good thing, but I haven't had time to really get into it yet.)
bascule Posted January 10, 2008 Posted January 10, 2008 The real solution is to not use things like XMLHttpRequest directly. There's several libraries out there with cross-browser compatible APIs. Try one of those: http://jquery.com/ http://www.prototypejs.org/ and http://script.aculo.us/ http://developer.yahoo.com/yui/
mooeypoo Posted January 10, 2008 Author Posted January 10, 2008 Simple validation isn't a problem. My problem is communication to a mySQL database without the user leaving the page (as in -- "This username already exists!" type of thing. Ajax solves this BEAUTIFULLY but it doesn't work on IE The simple "alphabet only" / "length>3" rules i do in javascript anyways. It's the db-connection that is a problem :\ I dont want the user to submit details and then finding out his user is already used -- and having to fill everything up again. ~moo The real solution is to not use things like XMLHttpRequest directly. There's several libraries out there with cross-browser compatible APIs. Try one of those: http://jquery.com/ http://www.prototypejs.org/ and http://script.aculo.us/ http://developer.yahoo.com/yui/ Cool I'm looking into those.. any suggestions about a preferred one, or just any? ~moo I think I have an example of a fancy client-side validator here somewhere... Yes, here we go: http://www.asp.net/AJAX/AjaxControlToolkit/Samples/ValidatorCallout/ValidatorCallout.aspx I don't know much about ASP.NET but I do stuff in PHP and I'm not too sure it works together....?
foodchain Posted January 10, 2008 Posted January 10, 2008 Simple validation isn't a problem. My problem is communication to a mySQL database without the user leaving the page (as in -- "This username already exists!" type of thing. Ajax solves this BEAUTIFULLY but it doesn't work on IE The simple "alphabet only" / "length>3" rules i do in javascript anyways. It's the db-connection that is a problem :\ I dont want the user to submit details and then finding out his user is already used -- and having to fill everything up again. ~moo Cool I'm looking into those.. any suggestions about a preferred one, or just any? ~moo I don't know much about ASP.NET but I do stuff in PHP and I'm not too sure it works together....? Its been years since I have looked into it but have you gave any thought to .jsp or jsp pages. I think one of those two are the title. I think those were generated with the main issue being the internet really. Java also has a huge library of existing things to be used really for programming that don’t run into nearly as much faults from compatibility issues mainly because its an interpreted language. Not being a .exe file though does not limit java really at that same time. Java can also be used with a variety of hardware devices in which you can even obtain certification in I think.
mooeypoo Posted January 10, 2008 Author Posted January 10, 2008 Its been years since I have looked into it but have you gave any thought to .jsp or jsp pages. I think one of those two are the title. I think those were generated with the main issue being the internet really. Java also has a huge library of existing things to be used really for programming that don’t run into nearly as much faults from compatibility issues mainly because its an interpreted language. Not being a .exe file though does not limit java really at that same time. Java can also be used with a variety of hardware devices in which you can even obtain certification in I think. Isn't JAVA heavy though? The big advantage of PHP is that it creates a text-output so the result is lightweight and doesnt take much from the client. Isn't JAVA heavy and massive for websites?
Cap'n Refsmmat Posted January 10, 2008 Posted January 10, 2008 Yes, people are moving away from applets because of that. Pangloss, doesn't IE 6 implement AJAX as an ActiveX object in MSXML? Wikipedia says that they only natively supported the XMLHttpRequest object in JS was in IE7.
foodchain Posted January 10, 2008 Posted January 10, 2008 Isn't JAVA heavy though? The big advantage of PHP is that it creates a text-output so the result is lightweight and doesnt take much from the client. Isn't JAVA heavy and massive for websites? I don’t know really. I just know from my past that java has extensive support in many forms. It also does not suffer many issues of compatibility across various computer systems, I also think garbage collection is a neat mechanism which could always improve maybe even at the interpreter level. It supports use with other programming languages and the existing code for use in say the libraries is also extensive. Plus I think that bean mechanism is neat for issues like scalability, or simply changing your program in time. Also its not restricted to being purely an internet language, you can make intricate fully 3D video games if you get bored for example, and then sell them to cell phone companies:D
Cap'n Refsmmat Posted January 10, 2008 Posted January 10, 2008 PHP does not depend on the end-user's system, has extensive libraries, has garbage collection, and was specifically designed for Web use.
mooeypoo Posted January 11, 2008 Author Posted January 11, 2008 Yeah I was thinking of using one of the libraries offered (javascript library) but most of them have either no documentation (and i have no idea how to implement them on PHP scripting) or are really messy... I think I'll solve my problem - at least for now - by giving up on proper AJAX and doing <iframe> coding. *sigh* btw.. after further check it seems that this is a known problem of IE6 that was fixed in IE7... but not enuff people upgraded so I can't rely on it YET. The system I am working on now must be REALLY easy (hence, field validation for stupid people is a must) and working everywhere, otherwise we may lose customers. *sigh again* If you hear 'bout anything or have any ideas, I'll be happy to hear 'em. ~moo
Cap'n Refsmmat Posted January 11, 2008 Posted January 11, 2008 Basically, you're dependent on people enabling safe ActiveX modules. Most people do. (Heck, vBulletin even uses AJAX, and they only use technologies they think "safe" to use.) It's just that paranoid people won't be able to use it.
mooeypoo Posted January 11, 2008 Author Posted January 11, 2008 Not really, no, it's more than paranoid -- anyone with a "public" computer (internet cafe, workplaces, etc) at my workplace AJAX doesn't work. *BUT* The good news is that I solved the problem. Check this place out: http://www.dynamicdrive.com/dynamicindex17/ajaxpaginate/index.htm Their ajax call engine apparantly circumvents the problems of ActiveX *and* throws some random string into the callout routines to fix (apparantly) a cache problem in IE. It's working, and I'm gonna use it. Woo-hoo! ~moo
bascule Posted January 11, 2008 Posted January 11, 2008 Pangloss, doesn't IE 6 implement AJAX as an ActiveX object in MSXML? Wikipedia says that they only natively supported the XMLHttpRequest object in JS was in IE7. Yes, that would be the case. Cool I'm looking into those.. any suggestions about a preferred one, or just any? jQuery is the cool new kid on the block. My vote goes to him.
Pangloss Posted January 11, 2008 Posted January 11, 2008 The good news is that I solved the problem. Check this place out: http://www.dynamicdrive.com/dynamicindex17/ajaxpaginate/index.htm Their ajax call engine apparantly circumvents the problems of ActiveX *and* throws some random string into the callout routines to fix (apparantly) a cache problem in IE. It's working, and I'm gonna use it. Woo-hoo! ~moo Good job. And you've added something to my classroom discussion regarding IE6 AJAX compatibility, which I always appreciate. I wasn't suggesting that you incorporate ASP into your PHP projects, btw. I was suggesting that you pull the Javascript code from the AJAX Control Toolkit, which is open source project, and see if it lets you do validation in IE6 without the ActiveX security warning. It was just a thought, but it sounds like the Dynamic Drive software will do exactly that, with less work on your part -- always a plus in my book.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now