[jQuery] Re: jquery compatibility test 01
Thanks for your suggestion. Now, I reduce my code as the following. But it still does not work under Opera. Maybe I have to use my own javascript instead of jquery, or I will try to fix this problem of jquery. === html head titleInsert title here/title script type=text/javascript src=/test/jquery-1.2.6.js/script script type=text/javascript function refreshProgress(){ $(#test1).val(e); setTimeout(refreshProgress, 1500); } $(function(){ $(#formtest).submit(function(){ setTimeout(refreshProgress, 1500); }); }); /script /head body form id=formtest action=s.jsp input id=test1 type=text name=fname value=Default / input type=submit id=submitButton value=submit/ /form /body /html === On Wed, May 28, 2008 at 7:47 PM, Ariel Flesler [EMAIL PROTECTED] wrote: Reducing that to the real situation... you're setting a number as value to a text field. That did cause troubles (for selects) but was fixed on 1.2.6. I tried this (setting the val to a text field) and worked well. Maybe something else is failing ? try to remove all the irrelevant code and generate a minimalistic test case. Cheers -- Ariel Flesler http://flesler.blogspot.com On 28 mayo, 17:25, arden liu [EMAIL PROTECTED] wrote: Hi, Today, I did some tests of compatibility among IE 7.0.5730.11, Firefox 2.0.0.14, Opera 9.27, Safari 3.1.1 The following JSP(includes Javascrpt) works fine under all these browser. Then I used JQuery to implement the same function, it works fine under IE/FF/Safari The submit function does not work correctly under Opera. Maybe I did not use Jquery correctly, or it is a compatibility problem of jquery-1.2.6. Thanks. Arden ===Javascript===== ?xml version=1.0 encoding=UTF-8 ? %@ page language=java contentType=text/html; charset=UTF-8 pageEncoding=UTF-8% %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c% !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 / titleInsert title here/title script type=text/javascript var ipVal=0; function refreshProgress(){ ipVal = ipVal + 1; document.getElementById('test1').value=ipVal; setTimeout(refreshProgress(), 1500); } /script /head body button id=buttonTest onclick=setTimeout('refreshProgress()', 1500);Click Me!/button form id=formtest action=s.jsp onsubmit=setTimeout('refreshProgress()', 1500); input id=test1 type=text name=fname value=Default / input type=submit id=submitButton value=submit/ /form /body /html =JQuery=== ?xml version=1.0 encoding=UTF-8 ? %@ page language=java contentType=text/html; charset=UTF-8 pageEncoding=UTF-8% %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c% !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 / titleInsert title here/title script type=text/javascript src=c:url value='/javascripts/jquery/jquery-1.2.6.js'//script script type=text/javascript var ipVal=0; function refreshProgress(){ ipVal = ipVal + 1; $(#test1).val(ipVal); setTimeout(refreshProgress, 1500); } $(function(){ $(#buttonTest).click(function(){ setTimeout(refreshProgress, 1500); }); $(#formtest).submit(function(){ setTimeout(refreshProgress, 1500); }); }); /script /head body button id=buttonTestClick Me!/button form id=formtest action=s.jsp input id=test1 type=text name=fname value=Default / input type=submit id=submitButton value=submit/ /form /body /html =s.jsp=== ?xml version=1.0 encoding=UTF-8 ? %@ page language=java contentType=text/html; charset=UTF-8 pageEncoding=UTF-8% %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c% !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 % Thread.sleep(1); % /head body button id=buttonTestClick Me!/button /body /html
[jQuery] jquery compatibility test 01
Hi, Today, I did some tests of compatibility among IE 7.0.5730.11, Firefox 2.0.0.14, Opera 9.27, Safari 3.1.1 The following JSP(includes Javascrpt) works fine under all these browser. Then I used JQuery to implement the same function, it works fine under IE/FF/Safari The submit function does not work correctly under Opera. Maybe I did not use Jquery correctly, or it is a compatibility problem of jquery-1.2.6. Thanks. Arden ===Javascript= ?xml version=1.0 encoding=UTF-8 ? %@ page language=java contentType=text/html; charset=UTF-8 pageEncoding=UTF-8% %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c% !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 / titleInsert title here/title script type=text/javascript var ipVal=0; function refreshProgress(){ ipVal = ipVal + 1; document.getElementById('test1').value=ipVal; setTimeout(refreshProgress(), 1500); } /script /head body button id=buttonTest onclick=setTimeout('refreshProgress()', 1500);Click Me!/button form id=formtest action=s.jsp onsubmit=setTimeout('refreshProgress()', 1500); input id=test1 type=text name=fname value=Default / input type=submit id=submitButton value=submit/ /form /body /html =JQuery=== ?xml version=1.0 encoding=UTF-8 ? %@ page language=java contentType=text/html; charset=UTF-8 pageEncoding=UTF-8% %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c% !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 / titleInsert title here/title script type=text/javascript src=c:url value='/javascripts/jquery/jquery-1.2.6.js'//script script type=text/javascript var ipVal=0; function refreshProgress(){ ipVal = ipVal + 1; $(#test1).val(ipVal); setTimeout(refreshProgress, 1500); } $(function(){ $(#buttonTest).click(function(){ setTimeout(refreshProgress, 1500); }); $(#formtest).submit(function(){ setTimeout(refreshProgress, 1500); }); }); /script /head body button id=buttonTestClick Me!/button form id=formtest action=s.jsp input id=test1 type=text name=fname value=Default / input type=submit id=submitButton value=submit/ /form /body /html =s.jsp=== ?xml version=1.0 encoding=UTF-8 ? %@ page language=java contentType=text/html; charset=UTF-8 pageEncoding=UTF-8% %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c% !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 % Thread.sleep(1); % /head body button id=buttonTestClick Me!/button /body /html
[jQuery] Re: my code only works under firefox
Hi, Scott After I added incrementing parameter, it works fine in IE, but it still does not work under Opera 9.27 and Apple Safari 3.1.1. Thanks again. Arden = var ipVal=0; function refreshProgress() { var uploadTicket = $(#uploadTicket).val(); ipVal = ipVal + 1; $.getJSON( 'c:url value='/uploadprogress.spring'/', {uploadTicket:uploadTicket, ip:ipVal}, function(data){ $(#test1).val(data.demo); }); window.setTimeout(refreshProgress(), 1500); } = On Tue, May 27, 2008 at 12:54 PM, Scott Sauyet [EMAIL PROTECTED] wrote: arden liu wrote: The following code only works under Firefox, I do not know why it does not work under IE. It might help if we had the HTML output rather than the raw JSP code. But my first thought is that perhaps IE is caching the results and not calling your URL again. Could you add an incrementing parameter to the data? -- Scott
[jQuery] Re: my code only works under firefox
Hi, The following is HTML output. I will try to add an incrementing parameter. Thanks for your help. Arden == ?xml version=1.0 encoding=UTF-8 ? !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 / link href=/arden/styles/layout.css rel=stylesheet type=text/css/ title Insert title here /title link href=/arden/images/favicon.ico rel=shortcut icon/ meta http-equiv=Content-Type content=text/html; charset=UTF-8 / script type=text/javascript src=/arden/javascripts/jquery/jquery-1.2.6.js/script script type=text/javascript function refreshProgress() { var uploadTicket = $(#uploadTicket).val(); $.getJSON( '/arden/uploadprogress.spring', {uploadTicket:uploadTicket}, function(data){ $(#test1).val(data.demo); }); window.setTimeout(refreshProgress(), 1500); } $(function(){ $(#uploadForm).submit(function(){ $(:submit,this).attr(disabled, disabled); window.setTimeout(refreshProgress(), 1500); }); }); /script /head body div id=container div id=header header /div div id=menu ul li a href=/arden/home.springHome/a/li li a href=/arden/photo.springPhoto/a/li li a href=/arden/hiking.springHiking/a/li li a href=/arden/computer.springComputer/a/li /ul /div div id=contentwrapper form id=uploadForm method=post action=imageuploadnew.spring enctype=multipart/form-data table tr tdFile:/td td input type=hidden id=uploadTicket name=uploadTicket value=3/ input type=hidden name=albumId value=1/ input type=file name=file01/ input type=text id=test1 name=test/ /td /tr tr td/td td input type=submit id=submitButton value=Submit/ /td /tr /table /form /div div id=footer ul lia href=/arden/about.springAbout/a/li lia href=/arden/powerby.springPower By/a/li lia href=/arden/language.springLanguage/a/li /ul /div /div /body /html == On Tue, May 27, 2008 at 12:54 PM, Scott Sauyet [EMAIL PROTECTED] wrote: arden liu wrote: The following code only works under Firefox, I do not know why it does not work under IE. It might help if we had the HTML output rather than the raw JSP code. But my first thought is that perhaps IE is caching the results and not calling your URL again. Could you add an incrementing parameter to the data? -- Scott
[jQuery] change innerHTML
In my html, I have the following span to show upload percentage: span id=progressBarText0%/span I tried to update the percentage using the following javascript: $(#progressBarText).innerHTML = 76%; But it does not work. :( Thanks. Arden
[jQuery] Re: change innerHTML
Hi, I tried the following, which works fine. $(#progressBarText).attr(innerHTML, data.uploadProgress.percent + %); Thanks. Arden On Tue, May 27, 2008 at 4:45 PM, arden liu [EMAIL PROTECTED] wrote: In my html, I have the following span to show upload percentage: span id=progressBarText0%/span I tried to update the percentage using the following javascript: $(#progressBarText).innerHTML = 76%; But it does not work. :( Thanks. Arden