Re: [DQSD-Users] establishing pattern for unique url per date
After all that I was looking through the archives and found steve poirier's message titled Subject: RE: [DQSD-Users] COMX.XML - missing Joy of Tech User Friendly (again) comx /userfriendly was setup all the timeand no one tipped me off :-( :-) Tom. Shawn K. Hall wrote: Hi Tom, I am working on a search for the daily static...I am trying to figure out the pattern they use to come up with the name so I can compose it given the date. I would just use an XmlHttp hit the first time, pattern match "uf*.gif", and then a second request for the image. This is some code I've migrated from one of my homebrew samples. Save it as a new htm file: '// html head title Test /title script language="_javascript_" var ksRoot = "http://www.userfriendly.org/cartoons/"; --- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk=120709=263057=121642 ___ To unsubscribe visit: https://lists.sourceforge.net/lists/listinfo/dqsd-users DQSD-Users@lists.sourceforge.net http://sourceforge.net/mailarchive/forum.php?forum_id=8601
Re: [DQSD-Users] establishing pattern for unique url per date
Hi Shawn, I have been playing with your code and learning about Ajax. It works great for IE, but I have been trying to make it work for Firefox. I replace your var xmlHttp = new ActiveXObject(Microsoft.XmlHttp); with var xmlHttp = createRequestObject(); where : function createRequestObject() { var request; try { request = new ActiveXObject(Msxml2.XMLHTTP); } catch(e) { try { request = new ActiveXObject(Microsoft.XMLHTTP); } catch(f) { request = null; } } if(!request typeof XMLHttpRequest != undefined) { request = new XMLHttpRequest(); } return request; } It still works with IE, but not with Firefox, watching with venkman it gets to request = new XMLHttpRequest(); But when Open is called it fires the catch error handler. Have not been able to figure this out yet. Any experience with doing this for Firefox? Cheers, Tom. Shawn K. Hall wrote: This is some code I've migrated from one of my homebrew samples. Save it as a new htm file: '// html head title Test /title script language=javascript var ksRoot = http://www.userfriendly.org/cartoons/;; function showImage( sImage ){ var s = ''; try{ //attempt to obtain the content var sUrl = http://ars.userfriendly.org/cartoons/?id=; + sImage; var xmlHttp = new ActiveXObject(Microsoft.XmlHttp); xmlHttp.open(GET, sUrl, false); xmlHttp.send(); //get the response content from the remote site var sBody = xmlHttp.responseText; var rx = /(\/archives\/[0-9a-zA-Z]+\/uf[\d]+\.gif)/g; //3456789`123456789`123456789`123456789`123456789`123456789`123456789` var r; var i = 0; if ((r = rx.exec(sBody)) != null){ sParsed = r[1]; } sParsed = sParsed.substr(1); }catch(e){ alert( It didn't work! + \n + e.number + :: + e.description); } var o = document.getElementById('testimg'); o.src = ksRoot + sParsed; } /script /head body img src=http://12pointdesign.com/stock/images/ra-button.gif; id=testimg / br / a onclick=javascript:showImage('20060120'); 20060120 /a br / a onclick=javascript:showImage('20060121'); 20060121 /a br / a onclick=javascript:showImage('20060122'); 20060122 /a br / a onclick=javascript:showImage('20060123'); 20060123 /a br / /body /html '// --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642 ___ To unsubscribe visit: https://lists.sourceforge.net/lists/listinfo/dqsd-users DQSD-Users@lists.sourceforge.net http://sourceforge.net/mailarchive/forum.php?forum_id=8601
RE: [DQSD-Users] establishing pattern for unique url per date
Hi Tom, I am working on a search for the daily static...I am trying to figure out the pattern they use to come up with the name so I can compose it given the date. I would just use an XmlHttp hit the first time, pattern match uf*.gif, and then a second request for the image. This is some code I've migrated from one of my homebrew samples. Save it as a new htm file: '// html head title Test /title script language=javascript var ksRoot = http://www.userfriendly.org/cartoons/;; function showImage( sImage ){ var s = ''; try{ //attempt to obtain the content var sUrl = http://ars.userfriendly.org/cartoons/?id=; + sImage; var xmlHttp = new ActiveXObject(Microsoft.XmlHttp); xmlHttp.open(GET, sUrl, false); xmlHttp.send(); //get the response content from the remote site var sBody = xmlHttp.responseText; var rx = /(\/archives\/[0-9a-zA-Z]+\/uf[\d]+\.gif)/g; //3456789`123456789`123456789`123456789`123456789`123456789`123456789` var r; var i = 0; if ((r = rx.exec(sBody)) != null){ sParsed = r[1]; } sParsed = sParsed.substr(1); }catch(e){ alert( It didn't work! + \n + e.number + :: + e.description); } var o = document.getElementById('testimg'); o.src = ksRoot + sParsed; } /script /head body img src=http://12pointdesign.com/stock/images/ra-button.gif; id=testimg / br / a onclick=javascript:showImage('20060120'); 20060120 /a br / a onclick=javascript:showImage('20060121'); 20060121 /a br / a onclick=javascript:showImage('20060122'); 20060122 /a br / a onclick=javascript:showImage('20060123'); 20060123 /a br / /body /html '// Regards, Shawn K. Hall http://12PointDesign.com/ --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://sel.as-us.falkag.net/sel?cmd=lnkkid=103432bid=230486dat=121642 ___ To unsubscribe visit: https://lists.sourceforge.net/lists/listinfo/dqsd-users DQSD-Users@lists.sourceforge.net http://sourceforge.net/mailarchive/forum.php?forum_id=8601