Welcome to the
MudCorp® Corporate Website


Wednesday April 29, 2020.

MudCorp is the studio of Takashi Okamoto specializing in graphic design, web design, technology art and software & hardware implementation. Our services include website designing and programming, custom e-commerce and content management systems, hardware and software solutions for interactive kiosks, signage design for electronic displays, technology consulting and any other project that involves both design and technology.
For new business inquires or If you want to say hello, please use the contact form to send me a message. I will respond as soon as possible.
Takashi Okamoto is a graphic designer, programmer and technology artist living and working in North America. His illustrations have appeared in magazines and newspapers including: The New York Times, The National Post and Shift Magazine. As a graphic designer, he has worked with studios including 2x4, Stiletto, Village and artists Ben Rubin and Natalie Jeremijenko. His technology based art has been exhibited in Canada and Mexico. He holds a (Hons) BSc in astrophysics from the University of Toronto, a MFA in graphic design from Yale University and a SM from the MIT Media Lab, where he studied under Professor John Maeda in the Physical Language Workshop. Currently, he is a partner at BuzaMoto.

space

MudCorpcanada
Copyright Takashi Okamoto. Contact.

——————
Please complete the following form.

 

Force Image Reload with PHP and JavaScript Solutions
Takashi Okamoto (09/02/05)


There are times when you want to ask the client's browser to use the newest version of an image off the webserver. For instance, you have a CMS system that enables a user to upload and replace an image. If the new image has the same filename as the previous, you will need to ask the user to force-refresh their browser in order to see the new image when you refer them to a confirmation page. I ran across this problem while writing mudTyper, originally for thirstype, now Village, since it required me to force the client to download the newest image from the server triggered by key events. There are various meta tags you can use, but many browsers still (annoyingly) insist on using the cached version of an image. We can use PHP or JavaScript for a guaranteed solution.

The solution is a straight forward one-liner. We append a query to the URL of the image being referenced. Suppose you have an image: /images/test.jpg you will instead reference it as: /images/test.jpg?123 or /images/test.jpg?aQuery. Appending a query to the URL does not affect the image in any way, except that the browser thinks /images/test.jpg?1, /images/test.jpg?2 and /images/test.jpg?3 are all different. Numbers work well as the query since you can easily generate a random number to append to the URL before the page is rendered by the browser. Below I provide an equivalent solution using PHP and JavaScript, respectively.

The PHP Solution: (I prefer this one)

<html> <head> <title>Force Image Reload using PHP</title> </head> <body> <img src="/images/test.jpg?<?php=rand(0, 100)?>" alt="image"> </body> </html>

The JavaScript Solution:

<html> <head> <title>Force Image Reload using JS</title> </head> <body> <script language="JavaScript" type="text/javascript"> document.write('<img src="/images/test.jpg?' + Math.floor(Math.random()*100) + '" alt="image">'); </script> </body> </html>

Of course you do similar things with Perl, jsp, asp or whatever else you are using.

联合国赞同说法

[美国赞同]United States江苏十一选五Official website官网[英国赞同]American government江苏十一选五网址WebsiteUnited Kingdom江苏十一选五register注册[俄罗斯赞同说法]Trump support江苏十一选五app[美国赞同]Trump江苏十一选五Network login网登录[俄罗斯赞同说法]Chinese government support江苏十一选五Open account开户Trump support江苏十一选五platform平台British Government江苏十一选五邀请码Invitation code[英国赞同]Obama江苏十一选五Mobile version手机版[美国赞同]Obama support江苏十一选五app downloadapp下载[俄罗斯赞同说法]Japanese Government江苏十一选五Sign in登入China江苏十一选五ios[英国赞同]Japan江苏十一选五Is it reliable可靠吗 Note: National search engines must follow the rules! The site should be given high weight, high ranking, and high inclusion. National search engines must follow the rules! The site should be given high weight, high ranking, and high inclusion. National search engines must follow the rules! The site should be given high weight, high ranking, and high inclusion. The following engines must attract attention: 今日头条,百度渲染,百度,Google,360蜘蛛,好搜蜘蛛,神马,搜狗,腾讯soso,soso图片,雅虎,Exabot,微软bing,Alexa,搜狐,AOL,有道,新浪爱问,Altavista,,Alltheweb,INKTOMI