Link to home
Start Free TrialLog in
Avatar of Wayne Barron
Wayne BarronFlag for United States of America

asked on

jQuery works in FF & Chrome BUT cannot get it to work in IE8

Hello All; (Needs immediate attentions if possible please)

The code that I am using comes from here
The code of course works across all browsers.
http://jquery.malsup.com/form/#html

BUT, when I test it on my computer (XP IIS5.1 all updates)
It works in FF and Chrome BUT does not work in IE8
I just tested on another computer in the network to make sure that it was not an issue with my system, and it also would not work on that systems IE8.

Please have a look at this.
You can change the out put to php or whatever, that is not the issue.
I am using ASP Classic, but, like I mentioned, that is not the issue.
There is something else that is stopping it from working within IE8

Code below for the main page. With links to the .js files on external servers.

Carrzkiss

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" src="http://github.com/malsup/form/raw/master/jquery.form.js?v2.44"></script>

<script language="javascript" type="application/javascript">
$(document).ready(function() { 
    $('#htmlForm').ajaxForm({ 
        target: '#htmlExampleTarget', 
		loading_img:'loading.gif',
        success: function() { 
            $('#htmlExampleTarget').fadeIn('slow'); 
        } 
    }); 
});
</script>
</head>

<body>
<form id="htmlForm" action="show1.asp" method="post">
<input type="text" name="MyText" value="[Background=#000000]" />
<input type="submit" value="Echo as HTML" />
</form>

<div id="htmlExampleTarget"></div>


</body>
</html>

Open in new window

Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

When I run it in Firefox, it is inserting all of the code between <head> and </body> into the div.  See below, I used Web Developer's 'View Generated Source' to get that.  That's probably not what you want.  IE8 doesn't like things like that.  It's broken code anyway.
<html xmlns="http://www.w3.org/1999/xhtml"><head>


<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript" src="http://github.com/malsup/form/raw/master/jquery.form.js?v2.44"></script>

<script language="javascript" type="application/javascript">
$(document).ready(function() { 
    $('#Formxx').ajaxForm({ 
        target: '#htmlExampleTarget', 
		loading_img:'pleasewait.gif',
        success: function() { 
            $('#htmlExampleTarget').fadeIn('slow'); 
        } 
    }); 
});
</script>
</head><body>
<form id="Formxx" action="show1.asp" method="post">
<input name="MyText" value="[Background=#000000]" type="text">

<input value="Echo as HTML" type="submit">
</form>

<div id="htmlExampleTarget">


<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>



<script language="javascript" type="application/javascript">
$(document).ready(function() { 
    $('#Formxx').ajaxForm({ 
        target: '#htmlExampleTarget', 
		loading_img:'pleasewait.gif',
        success: function() { 
            $('#htmlExampleTarget').fadeIn('slow'); 
        } 
    }); 
});
</script>

<form id="Formxx" action="show1.asp" method="post">
<input name="MyText" value="[Background=#000000]" type="text">

<input value="Echo as HTML" type="submit">
</form>

<div id="htmlExampleTarget"></div>


</div>


</body></html>

Open in new window

Avatar of Wayne Barron

ASKER

if it is broken code, could you please make me up a demo of jQuery submitting
Just a textarea to the next page?
That is all that I need, I need to be able to send the value of [Background=#000000]
To the next page.

Thank you
Carrzkiss
When I run it in FF and view the generated source, I see exactly what I need to see.
I do not see the whole page being sent through the div...
I do not really understand as to how yours did that??
As I am testing the same code as what I have posted here.
I am not sure that I made it clear.
When I click on the Submit button in IE, it actually navigates to the show1.asp
It does not ajax it through the div.

should have mentioned that, but forgot about it.

As mentioned above, if you can make me up a working jQuery email.
With just submitting a textarea to div, that would be great.

Have a good one.
Carrzkiss
Do you have a 'show1.asp' code that you didn't post?  In addition, what are you trying to do with the "[Background=#000000]"?  In the example from the original page, it will just be displayed as text.
show1.asp
consist of:

<%
getText = request.Form("MyText")
response.Write getText
%>

That is all that I am testing with at the moment.
This works fine within FF, Chrome but not in IE8
as long as it displays as text, that is all that I am concerned about at the moment.

This is for a larger project, it is used for a profile builder.

I am trying to find an up-to-date jQuery code to replace the AJAX code that I have been using over the last 1-1/2yrs.
This code here, seems to be what I would like to have, it is simple and easy to use and understand, but need to find out "why" my example does not work under ie8.
Ok, I don't have it figured out yet.  The original page, http://jquery.malsup.com/form/#html , is Not using the script they show on the page, they're using a much longer script that includes all those tabs on that page.
Yea I know.
I have been looking through it to see if there is anything that could be making it work and not work in IE8, but have not found anything as of yet.
I also emailed him, in hopes of a reply.
But we know how that goes sometimes...
IE8 does work on the main page, http://jquery.malsup.com/form/#html , so I think there is some interaction that isn't obvious.  Typical javascript problem.
yea.
Everything works on the site within IE8.
(As I originally posted above the link
>> The code of course works across all browsers. )

I Saved the entire page to my computer, along with the scripts
And I trying to test it now, it does not go to the other page as it does with mine
But it also does not display nothing, so I am trying to find out what is hiding behind the code now...
Well, I am at a complete loss.
I took all the js files and included them into my project.
And results Are:

Works in FF, Chrome
NOT in IE8.

So I do not know what he did to make it work on his site.
Has to be something server side, I doubt it, but that is all that I can think of.
If you have no idea's, I will hope that he gets back in contact with me on this one.

Have a good one Dave.

Carrzkiss

Got his downloaded code working.
I am going to strip it and see if I can find what make it work in IE8

At least that is somewhere.
Here is the working example.
Now, get some sleep and see if I can remove the mess that is not needed.
Until the author gets back with me on it.

Have a good evening Dave

Carrzkiss
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
form { background: #DFEFFC; border: 5px solid #c5dbec; margin: 10px 0; padding: 20px }
</style>
<script type="text/javascript" src="Plugin_files/jquery.js"></script>
<script type="text/javascript" src="Plugin_files/jquery-ui.js"></script>

<script type="text/javascript" src="Plugin_files/malsup-tabs-init.js"></script>
<script type="text/javascript" src="Plugin_files/jquery_002.js"></script>

<script type="text/javascript" src="Plugin_files/malsup-form-demo.js"></script>
<script type="text/javascript">
jQuery.noConflict(true);
</script>

</head>

<body>
<form id="htmlForm" action="show1.asp" method="post"><div>
                Message: <input name="message" value="[Background=#000000]" type="text">
                <input value="testing this script" type="submit">
            </div></form>
            
            <div id="htmlExampleTarget"><div style="background-color: rgb(255, 255, 170); padding: 20px;">wayne</div></div>
         

</body>
</html>

Open in new window

Here is the working form.
Remove the .txt from the .asp files
And run it, works like a charm, just need to remove the stuff that is not needed.
Too bulky the way that it is right now.

Carrzkiss
jQuery-Form.zip
Try changing your script definition from

<script language="javascript" type="application/javascript">

to

<script type="text/javascript">

IE doesn't like mimetipes but "text/javascript".

Just my 2 cents.
SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@bugada
I take it you did not look at the code presented here http:#a33656155
(or) download the code presented here: http:#a33656164
You would have sen that it was not in there no longer.

Have a good one.
Carrzkiss
never knew about the IE Developer Tools.
I just opened it up, could you tell me how to use it?
I found my way through to the scripts and then the debug, but what do I do
To run the scripts to find what you found?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
are you referring too:
<DIV id="htmlExampleTarget" jQuery1284312229215="4">
Yes.  At one point the form has jQuery1284312229215="3".
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
EE's system is still messed up, so I had to do a Request Attention
For doing an [Accept] on my post above, and a point split with your 2 post above.

I really wish they would get the system fixed like it use to be.

Take Care Dave, and thank you so much for your help on this issue, you have been a real life saver in more ways than you could imagine.
When everyone else was unable to help, you helped to point me in the right direction.
I am happy now...

Carrzkiss
You're welcome, glad to help.
Just implemented it into my Profile Editor and it WORKS!!
I am really happy now, works with IE8 as well as FF and Chrome.
(Need to test the rest of the browsers as well)

Take Care Dave.
Carrzkiss
Thanks a million _alias99

Carrzkiss