Javascript with window.location.href no longer working in Content Editor in Sharepoint 2010 where users have IE8

I have recently found that when using a Sharepoint 2010 Content Editor web part to house some Javascript that the window.location.href (or window.location) is not working when the end users have IE8 installed on their PC's.  We have confirmed
that the window.location.href is working if the users are on IE7 or Google Chrome with the same Javascript.  In addition, we added alert() to the javascript to ensure that it was infact running, which the alerts appeared on the screen with no issues. 
The result that I am receiving in IE8 is that when the window.location.href is set to the url that the user should be directed to, it simply refreshes the current page and leaves the user where they originally were.
I have seen the posts to have my site setup as a Trusted Site, but this is not an option for our company as they defined all internal Sharepoint sites as trusted already.  Besides this, having all users go into their Internet Options is not really a
solution but a means to annoy your users.
What I am looking for is a permanent solution that I can make within my javascript that will work for both IE7 and IE8 users within a Sharepoint 2010 environment.  If anyone has any suggestions, please let me know.  Thanks in advance.
Below is a snipet from my javascript code for review:
<script type="text/javascript">
function RedirectUrl() {
alert('button pressed');
var tb = document.getElementById("tbSearch").value;
var cs = document.getElementById("sfield").value;
var url = "";
if (tb != "") {
url = "FilterName=" + cs + "&FilterMultiValue=*" + tb + "*";
if (cs == "Request%5Fx0020%5FID1"){
alert("Request%20ID%20Search.aspx?" + url)
window.location.href = "Request%20ID%20Search.aspx?" + url;
else {
window.location.href = "All%20Requests.aspx?" + url;
else {
return false;
function ClearUrl() {
window.location.href = "All%20Requests.aspx";
</script>
<br/>
<span style="font-family: calibri; color: #000066; font-size: 14pt; font-weight: bold">Search</span>
<br/>
<span style="font-family: calibri; color: black">Search Field: </span>
<select id="sfield" style="font-family: calibri; font-size: 10pt">
<option value="Request%5Fx0020%5FID1">Request ID</option>
</select> &#160;
<span style="font-family: calibri; color: black">Search Text: </span>
<input id="tbSearch" onkeypress="if (event.keyCode == 13) document.getElementById(&#39;btnSearch&#39;).click()" style="font-family: calibri"/>
<button id="btnSearch" onclick="return RedirectUrl();" type="submit" style="font-family: calibri">Search</button>
<button id="btnClear" onclick="return ClearUrl();" type="submit" style="font-family: calibri">Clear Search</button>
<br/>
<br/>
<span style="font-family: calibri; color: #000066; font-size: 14pt; font-weight: bold">Search Results - All Requests</span>
<br/>

Hi,
According to your post, my understanding is that the window.location.href not worked in IE 8.
I think the issue
is likely due to the value of your variables. If they contain special or invalid characters, those needs to be passed through
encodeURIComponent before being assigned to window.location.href.
http://stackoverflow.com/questions/18278777/window-location-href-not-working-on-ie
http://stackoverflow.com/questions/6297291/window-location-problem-in-ie
You can also use the following methods to check whether it works.
Window.navigate();
Winodw.history.back();
Self.location.href;
Top.location;
Thanks & Regards,
Jason
Jason Guo
TechNet Community Support

Similar Messages

  • Javascript's window.location.href stopped working on FF 17.0.1

    I used window.location.href to navigate pages in my application. Suddenly it's not working anymore with upgrade to v 17.0.1
    Still works in v16... but most of the company users upgraded to v17, and now it's a big proglem
    WHAT TO DO?

    The piece of code that I have is something like
    "<a id="action_url" href="/abc/xyz" name="action_url">Data</a>"
    abc/xyz is a struts action

  • Trying to open a page in IE-tab using javascript, script type="text/javascript" window.location.href="chrome://coralietab/content/container.html?url=0,myurl" /script Error:Component returned failure code:0x80004005 (NS_ERROR_FAILURE) [nsIDOMLocation.href]

    I am trying to open a page in IE-tab using javascript like this, <script type="text/javascript"> window.location.href = "chrome://coralietab/content/container.html?url=0,myurl" ;</script>.Error occured : [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMLocation.href]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame ::myurl :: load :: line 234" data: no] I have IE-Tab plug-in installed..when I open the same link manually in mozilla,it works fine and page gets opened in Ie-tab.

    The only way this might be possible is by using the HostContainer object
    to access the HTML page and do it from there.

  • Help setting up Window.location.href to open a file, and 1 other issue

    Hey there,
    I am a student currently working on a school project where I must make a website. I am trying to set up: window.location.href="C:\Users\*PCNAME*\Desktop\*SITE*"; in that fashion to open up a local file on my HDD, so when I click a specific area, it opens that page from my local files. This setting works with opening web pages like "http://www.google.com" just fine, but when I attempt to instead open up a file location I am given an error.
    Also, my other question is how to have more than 1: <script type="text/javascript"> function LinkTo(){, so that I can have 2 seperate buttons on my web page linking to 2 seperate sites.
    Here is a link to the PasteBin with my code: http://pastebin.com/Eawy2hcL
    Basically, I am wondering how to set up window.location.href to open  up a page located in my files rather than from the internet like Google or Facebook; and, I am wondering  how to have multiple LinkTo scripts set up so different buttons link to different pages and how to link those buttons to each script. I am new to Dreamweaver, so forgive me if anything is blindingly obvious! 

    Okay, I'll try to explain better. Btw, thanks for the bottom part. Figured out I am not supposed to put the full location of the file, only the page (index.html), not C:\Users\*NAME*\etc...
    Anyways, I am wanting multiple scripts.
    Basically, I want the left cell to, when clicked, go to NewCars.html, and the right cell to link to UsedCars.html. It is a table that I have configured to be clicked anywhere in the cell rather than just having to click the words to go to a link. The code is:
    <table width="100%" border="1">
      <tr>
        <td style="cursor:pointer;cursor:hand;" onClick="LinkTo()" width="50%" bgcolor="#C5B8B8"><h2 style="text-align: center">Shop New</h2></td>
        <td style="cursor:pointer;cursor:hand;" onClick="LinkTo()" width="50%" bgcolor="#C5B8B8"><h2 style="text-align: center">Shop Used</h2></td>
      </tr>=-
    </table>
    I have the LinkTo script set up, but I don't know how to add another LinkTo script that goes to a different page so that way the first LinkTo script for the"Shop New" cell takes you to the NewCars page, while the "Shop Used" cell takes you to the ShopUsed page.

  • Javascript issue calling location.href

    Hi
    I am calling a javascript function from the click event of a command button.
    function test1() {
    // alert('Simple alert');
    location.href='/context/faces/test';
    //window.location='/context/faces/test';
    The redirection is not working here from the method. If I uncomment alert in the method and accept the alert the rediredirection is happening. Any one tell me the issue here ? Is there any other way to have the redirection using javascript ?
    THanks
    Suneesh

    Suneesh,
    What "doesn't work" about it? On Page 2, you can have a command button/command link that has an Action method that returns a navigation/control flow case which returns you to Page 1.
    One thing to be aware of... if you are using ADF Task Flows, you must run the page using the task flow URL, not by running the JSPX page's URL. In JDev, test by right-clicking Page 1 in the task flow diagram and choosing Run.
    John

  • Location services no longer working after 4.3.3 update.

    I have a 3rd Gen 32GB touch, and after updating the software today, my location services no longer work. My device fails to find my location for the maps app, as well as other 3rd party apps. There was no problem with finding my location prior to this update, and other devices on my network aren't having an issue pinpointing a location either.
    I have tried restoring my iPod as well as turning the location services on and off.
    Any help would be greatly appreciated (:

    I have the same iTouch and have experienced the same problemafter updating the software.
    If you go to Settings>Location Services and it says “ON yet it’s gray and faded, please read on.
    Go to Settings>General>Restrictions (Enter Passcode)>Allow Changes:Location
    The page should have something that would say “Allow Changes”, “Don’t AllowChanges”….and some of the 3rd party apps that need location servicesas you mentioned listed below. Tap “Allow Changes” and slide “Location Services”ON. Then manually slide the 3rd party apps that you want to enableLocation Services to ON.
    Then, you’re good. Hope it works out. Frustrating, I know.

  • Syncing with iPad mini does no longer work since latest update of iTunes

    Syncing with iPad mini does no longer work since latest update of iTunes and iPad mini

    Hi grecokev,
    Thank you for contributing to the Apple Support Communities.
    You mention that your iPod nano is no longer recognized by iTunes after an update. Reinstalling iTunes is a good troubleshooting step, and if the device still doesn't appear in iTunes, try the following steps next:
    Turn off your computer and your iOS device or iPod, then turn them on again.
    Check to make sure that you've installed all required updates for your computer.
    Verify that the 30-pin to USB cable or Lightning Connector to USB cable is free of debris and not damaged. If another cable is available, test with that cable instead.
    USB cables that are bundled with third-party products or accessories might work only to charge those products and might not transmit data. Also, if you're using a third-party case or extended battery pack, try removing the case and connecting the Apple-supplied USB cable directly to your device.
    You can find these steps in this troubleshooting article:
    iPhone, iPad, or iPod not recognized in iTunes for Windows - Apple Support
    If the steps above don't solve it, see the section of the article called "Verify that Apple Mobile Device Support is installed" for some additional steps to try on your PC.
    Best Regards,
    Jeremy

  • I forgot my password for my iTunes account and the email that is associated with my iTunes account no longer works. How do I recover my password and be able to change my security questions?

    I forgot my password for my iTunes account and the email that is associated with my iTunes account no longer works. How do I recover my password and be able to change my security questions?

    Forgotten Security Questions / Answers...
    See Here > Apple ID: Contacting Apple for help with Apple ID account security
              Ask to speak with the Account Security Team...
    Or Email Here  >  Apple  Support  iTunes Store  Contact
    More Info >  Apple ID: All about Apple ID security questions
    Note:
    You can only set up and/or change a Rescue Email Before you forget the questions/answers

  • Using Time Capsule with Windows 7. Won't work when modem connected directly to Time Capsule, must be connected through another router.

    Apple Time Capsule working with Windows 7 PC will not work when modem is connected directly to the Time Capsule.  Only when a Cisco Linksystem is connnected inbetween the modem and the Time Capsule.

    Sorry but it needs much more specific info than this..
    What modem? Is it cable or adsl or some other?? Is it pure modem or broadband router included?
    Cable has specific issues different to adsl.
    If you used to use the Cisco/linksys router.. and have not reset the cable modem it will not work. Turn off the cable modem.. it must be powered down.. if battery backup drop out the battery. Remove the coax cable.. get it off. Power down everything else in the network.
    Plug in the modem to the TC wan port.
    Power up the modem.. wait 2min
    Power up the TC.. wait 2min
    Power up the clients.
    If it has worked you will now be able to open the airport utility on the windows computer and see the TC has a public ip on the WAN port. If not redo the whole thing but leave the modem off.. 15min.. 1 hour.. 1 day.. ring the cable company and ask them to reset. Usually a few minutes is enough.
    If you have a modem with combined router.. then bridge the TC. Just google search it.
    For other combos.. tell us specifics..

  • With Windows 7 Home Premium, whenever I start iTunes, I get a message that colors have been reverted to Windows Basic because iTunes won't support my Windows Aero configuration.  Is there a fix for the incompatibility?

    With Windows 7 Home Premium, whenever I start iTunes, I get a message that colors have been reverted to Windows Basic because iTunes won't support my Windows Aero configuration.  Is there a fix for the incompatibility?  I don't mind the color changes, but I'm having an external speaker problem that could be related to the incompatibility (at random times--usually several hours after start-up, my external speakers--connected via my Samsung Central Station's wireless docking station and computer-installed dongle--shut off and won't play until I restart.  I've investigated other options, but iTunes may be the problem.)  Thanks.

    Perhaps let's first try updating your Apple Software Update.
    Launch Apple Software Update ("Start > All Programs > Apple Software Update"). Does it launch and offer you a newer version of Apple Software Update? If so, choose to install just that update to Apple Software Update. (Deselect any other software offered at the same time.)
    If the ASU update goes through okay, try another iTunes install. Does it go through without the errors this time?

  • I am using Adobe Reader X on a laptop with Windows Vista OS and Adobe Reader XI on an older laptop with Windows XP OS.  While filling out the same form on each computer, I have found that I can save info on the older laptop, but not on the newer one.  Thi

    I am using Adobe Reader X on a laptop with Windows Vista OS and Adobe Reader XI on an older laptop with Windows XP OS.  While filling out the same form on each computer, I have found that I can save info on the older laptop, but not on the newer one.  This is a big problem.  I must be able to save on the newer computer.  Do I need to buy a new computer with a more up-to-date OS?  Please help.

    Adobe Reader X can only save reader-enabled forms. Adobe Reader XI can save all forms.

  • Href with scroll(0,0) no longer works!

    Until the update to V36.01, I used scroll(0,0) in an href as a link to the top of the page - which worked fine. It no longer works for me. Any ideas?

    Do you mean like this:
    &lt;a href="javascript:scroll(0,0)">To Top&lt;/a>
    It seems this should still be supported, per MDN: https://developer.mozilla.org/docs/Web/API/Window/scroll
    Does it make any difference if you use:
    &lt;a href="javascript:window.scroll(0,0)">To Top&lt;/a>
    or to separate your event handler from the HTML:
    &lt;a href="#" onclick="window.scroll(0,0); return false;">To Top&lt;/a>

  • "Activity window" in Safari no longer works to download YouTube videos. Why not? Workaround?

    For years I have used Apple's recommended standard technique whenever I wanted to download a Flash video embedded in a YouTube page to my hard drive:
    - Open a YouTube page and click on the video's "play" button to get it started;
    - Press command-option-A to then open up Safari's "Activity Window" which lists all the components of the page;
    - Find on the list the component for the loading Flash video, which is usually much larger (measured in MB rather than KB) than all the other components, and also is usually still in the process of loading, so it's easy to spot;
    - Double-click the component's name on the list in the Activity Window, and voila, the video downloads to my hard drive.
    This "trick" is described everywhere as THE standard way to download YouTube videos (and similar page components); and I have used it successfully for many years.
    HOWEVER, sometime very recently (not sure when, exactly -- a few weeks or months ago) YouTube has changed the way its pages are coded, so that this technique no longer works. When I open the Activity Window, instead of seeing one large loading video file that's easily identifiable, I see a whole series of large files, all exactly 1.7mb big (no matter how large the file size of the actual video in question is), and they constantly increase in number -- at first there are two such files, but over the seconds and minutes more and more appear. Furthermore, many files with no named size are constantly loading and then disappearing. And here's the whole point: I've tried double-clicking on ALL of these files, dozens of ways on dozens of YouTube pages, and none of the are the video file I seek and none of them cause the file to  download to my hard drive.
    If I click on one the mysterious 1.7mb components, I indeed get a ".flv" downloaded to my hard drive, but it's not actually a Flash video; clicking on its downloaded file icon just brings up a blank box or an error message saying that it's not really a video file at all. I think it's some sort of "decoy" file or something to do with streaming Flash code.
    To see what I mean, just go to YouTube, load any random video page, and then open Safari's Activity WIndow and try to download the video that way.
    This happens on an iMac running Safari 5.1 on OSX 10.6.8, and also on a MacBook Pro running Safari 5.0.2  on OSX 10.6.5, and on a few other new-ish Macs I tested it out on, but failed to note their version numbers.
    I'm presuming that this problem is not specific to my computer, but is caused by the way that YouTube altered the background code for their pages. I don't know if the glitch is an intentional attempt by YouTube to prevent downloads, or if it is an accidental "bug" of the new code. Either way:
    How can I fix the problem? Is there some other lesser-known built-in way for Safari/Mac to download the new kind of YouTube videos? Or is there some reliable freeware or shareware or plug-in or extension or whatever for Safari that would enable YouTube downloading?
    I tried a freeware program called "Evom" that was highly touted, but it too was thwarted by the new YouTube code and failed to extract any videos from the YouTube page, even though that's what the application was designed to do.
    As a side note, I will say that I also have (though rarely use) FireFox for Mac, and the "Unplug" plug-in installed on it, and that ALSO "broke" recently and no longer has the capacity to recognize or download YouTube videos, even though previously it worked fine. This is why I think the issue is not specific to my set-up or computer, but is due to a change in YouTube's underlying code.)
    Any help with an explanation, solution or workaround would be much appreciated (by me and by millions of others who I assume are facing the same problem!).

    Carolyn:
    I just now did exactly as you recommended. Result? No change.
    Even after trashing the files and restarting and everything else, the Activity Window and YouTube behave exactly as they did before.
    (I had actually previously tried something very similar to your recommendation, and it didn't have any effect then either.)
    In case it's helpful, here's an example of what one of the mystery components that load endlessly in the Activity Window is listed as:
    http://s.youtube.com/s?rendering=software&lact=102489&decoding=&rt=112.382&et=11 0.829&tsphab=1&st=69.939&tspne=0&tspfdt=262&nsiabblmin=62945.000&nsidf=2&tabsb=1 &ad_flags=0&h=360&nsiabblmean=72646.865&md=1&docid=zPxFu7taftE&bc=15194849&csipt =watch5ad&ad_event=3&el=detailpage&hasstoryboard=1&vid=72A5TVVpDgRoXDV3HvMeKPjLx BFdU61DC&fmt=34&cr=US&sd=BD075E8E6HH1336502192683396&vtmp=1&nsiabblmax=79054.000 &hl=en_US&ns=yt&nsivbblmax=774478.000&referrer=None&sidx=0&hbd=7790924&w=480&hbt =2.751&cid=6&sendtmp=1&sst=0&cfps=25.974025974025974&screenw=1440&mt=0.6&vq=auto &playerw=640&playerh=390&slots=sst~0;sidx~0;at~2_3&scoville=1&at=2_3&volume=100& art=1.842&mos=0&plid=AAS_iqoqfi0mjNc0&fs=0&nsivbblc=208&nsivbblmin=561638.000&bd =931267&allowed=1_1,1_3,2_1,2_3&bt=7.441&fvid=bNz97ILtwqc&screenh=900&len=127.92 &vw=480&nsivbblmean=668895.024&nsiabblc=208&vh=360&fexp=912001,914050,913539,919 306,907217,901802,906507
    And here's one of the 1.7MB components:
    http://o-o.preferred.comcast-lax1.v11.lscache8.c.youtube.com/videoplayback?range =1781760-3563519&expire=1336524839&id=ccfc45bbbb5a7ed1&burst=40&cm2=0&sver=3&upn =I_VxE0Lmh4Y&keepalive=yes&ipbits=8&algorithm=throttle-factor&itag=34&sparams=al gorithm%2Cburst%2Ccp%2Cfactor%2Cid%2Cip%2Cipbits%2Citag%2Csource%2Cupn%2Cexpire& source=youtube&signature=6F9B5B2CA58ACBA6AFE02FB8A54F1F74EE2B0F16.8E421BC37C3019 E806C22CF3E8866847D033565C&factor=1.25&ip=71.0.0.0&cp=U0hSS1VNUl9IU0NOMl9NR1ZJOm lxNTVmbm1vcDlO&key=yt1&fexp=912001%2C914050%2C901802%2C906507%2C907217%2C919306% 2C913539

  • Wi-Fi Sync with Windows 7 PC doesn't work

    I have both an iPhone 5s and iPad-3. I use iTunes (latest version) in a Windows 7 PC. No problems to sync with the USB cable, but Wi-Fi sync is totally unreliable.  I have spend lots of time reading all the information available online. Wi-Fi sync is configured right.  It is not a problem with either Antivirus software or the Firewall (I have tried disabling both).  I re-installed iTunes following the Apple support note on the subject.  On one time after I reinstalled, Wi-Fi worked, but only for the first sync.  When I turn on Wi-Fi in the iPad and iPhone, the iDevice always appear in iTunes but for a short while and it then dissapears. It is clear that they have some problem during the communication but neither iTunes nor the iDevice report any kind of error I could use to try to fix the problem.
    It is really frustrating, and I work in IT ... From what I have seen online, I am not alone with this problem. I have several iphone/iPad apps that do Wi-Fi syncs with applications in the Desktop, and they work every time.  I don't undertand why Apple can not implement a reliable Wi-Fi sync with iTunes.  I don't think it is to sell more Apple computers/laptops since there are many with those that have the same kind of problem. Could it be to sell more USB cables ?.

    mzhu2626 wrote:
    i have a windows 7 x64 with the latest version of chrome as it's default browser. i also have IE running with flash too. however, while flash works on IE, it doesn't work on chrome. i understand that to allow flash to work on chrome, you can access the global settings on the website, but i have this program running on my computer that needs flash to work and whenever i try to open it, this pops up:
    i can't click the allow, remember or close buttons. i can access global settings, but considering how this is just a program and not a website i don't think how helpful that'd be. can someone please help me?!
    See the "Known Issues" article re: Google Chrome to see if you recognize any of them: http://support.google.com/chrome/bin/static.py?hl=en&page=known_issues.cs
    There's a link to their Help forums near the foot of the page.

  • My 'run with administrative privileges' script no longer works - help

    Hey all. I have an applescript that shuts down the computer that I made a while back. I pulled it out today to use it and it no longer works. Here's part of the code I'm having trouble with:
    do shell script ¬
    "sudo shutdown -h now" password "myadminpassword" with administrator privileges
    On old machines this worked great, I would just put the admin password where myadminpassword is and it would work perfectly. Now though, I run it on my machine and I get the prompt to enter my admin username and password before it will shutdown.
    Now this is going on a remote install so I need it to work. Any ideas? The machine is running snow leopard, but it seems to still work on an old leopard macbook pro.

    Well, for one, do not use sudo in do shell script.
    The whole 'with administrator privileges' part takes care of elevating your privileges. sudo has no place in do shell script.
    Don't know if that's your issue, but it's the first thing I'd fix.
    If that doesn't help, are you running the script as your admin user?
    Nowhere in your script are you defining the username to run the command as, therefore it will attempt to run as the current user who may not be the same as your admin user, nor have the same password. You might need to include the username:
    do shell script "shutdown -h now" user name "admin" password "myadminpassword" with administrator privileges

Maybe you are looking for

  • Java.lang.Exception: Invalid AD_TOP Oracle Applications 11i

    Hi, I have tried to complete Oracle Application 11i installation, but I have one problem. I have multi node installation with 2 nodes(Virtual nodes with OEL 4). First for database software and database and second for everything else. I have successfu

  • Creating a new database on a MySQL server

    Hi, I am using the JDBC driver from http://www.mysql.com/products/connector-j/index.html and it works if I connect to an exixting database. I would like to implement extra functionality to my application by allowing the creation of new databases on a

  • How to deliver a product without a PO & SO

    Can anyone tell me a way by which I can transfer material from one company to another company under the same controlling area. The vendor company uses SAP-PS . How to deliver material incase there is no PO raised ? The vendor company doesn't wants to

  • Bluetooth tethering with Sprint is slowwwwww

    Is this normal? I get fast speed on the mobile handset, but when bluetooth tethered with the Mac...its super slow. I usually get like 700kbs on the handset, now im getting 100kbs the most.

  • State of the aert - IPR Protection and Licensing

    I really don't know what forum to post this in..... but given my own thoughts on where aspects of this issue might best be tackled, I thought I'd start here. I've been working with Java for about 8 years now. Clearly I'm rather positive about Java as