views:

197

answers:

4

I closed my old blog so I redirect our old blog to our new blog but if any user comes from the old blog then he can't watch our video in our blog.. i used

<script language="javascript" type="text/javascript">
    window.onload = function java() {
        window.location = "http://anirudhagupta.blogspot.com";
    }

</script>

But he redirect like a ajax so Silverlight video object is not worked so how can i solve it using jquery or javascript

A: 

just this should do the trick ( if you are using jQuery )


   $(document).ready(function() {
     window.location.href="http://anirudhagupta.blogspot.com"
   })

Rishav Rastogi
A: 

The code you've posted is not an AJAX redirect (which really doesn't exist, anyway). That Javascript redirect works fine for me. I don't see any Flash on your page, but the Silverlight is working fine.

JoshJordan
sorry for wrong issue it already solved thanks
everything is now fine.
@Anirudha: No, nothing is fine. Using JS redirects is a criminal offense
EFraim
criminal offense why. i am owner of this two blog and i have a right to use it. if you not know it then read Blogspot Privacy policy first.
@Anirudha... @EFraim is being sarcastic. He was simply saying the fact that it "works" doesn't mean it is the best solution, not that you were breaking the law.
Doug Neiner
+3  A: 

you shoulnd't use javascript to redirect to your new blog. there are better ways to do this (ie. 301 permanent redirect). anyway, the issue with videos is not related to the redirect.

gpilotino
+1 301 is by far the best option both for usability and for SEO (any ranking you have will migrate to the new URL). JavaScript and meta-refresh hacks are only for desperate situations where you can't do a proper redirect.
bobince
+5  A: 

Don't do JS redirects. This is the worst possible option. JS redirects are not reliable (what if the user has diasbled JS?), they break browser history behavior and they have much better and correct alternatives.

Prefereably, use one of these:

  • Server-side HTTP redirect (code 301)
  • <meta> redirect (such as: <meta http-equiv="REFRESH" content="0;url=http://www.new-domain.com"&gt;)
Yuval A