Blog Archives

Client Side Scripting

Check whether image exists on remote URL

Sometimes there is a situation where you need to display some default image if remote image URL does not exist. We have an application that shows up songs information from apple site and sometimes there is a missing artwork image.

Posted in Client Side Scripting Tagged with:

Run JavaScript when Ajax modal popup opens

Let’s say if you want to run some JavaScript method right after Ajax modal popup opens, we probably think injecting JavaScript method into page like this. if (!Page.IsStartupScriptRegistered(“PickerInit”)) Page.RegisterStartupScript(“pickerInit”,javascriptString); The JavaScript we inject using above method will be called on

Posted in Client Side Scripting, Microsoft Technology Tagged with: ,

JavaScript Timer Events

With JavaScript, it is possible to execute some code NOT immediately after a function is called, but after a specified time interval. This is called timing events. <html> <head> <script type=”text/javascript”> function timedMsg() { var t=setTimeout(“alert(‘5 seconds!’)”,5000) } </script> </head>

Posted in Client Side Scripting Tagged with:

Ads