Using window.location.search or .hash with task pane apps

Is there some way for a muli-page app to use query or hash parameters without causing problems for the Office 365 environment? It seems that a few search and hash params are used by office.js, and any meddling can cause the app not to load.
E.g. window.location.search: "?et=&_host_Info=Excel|Web|16.00"
I've had some success manipulating the hash params /before/ including office.js, though it's rather cumbersome as a pattern.

Yes, I mean on Office 365, on sharepoint.com.  Here's a small sample that attempts to highlight the issue:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<title>UrlParamsTest</title>
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.1.min.js" type="text/javascript"></script>
<link href="../../Content/Office.css" rel="stylesheet" type="text/css" />
<script src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js" type="text/javascript"></script>
<link href="../App.css" rel="stylesheet" type="text/css" />
<script src="../App.js" type="text/javascript"></script>
<link href="Home.css" rel="stylesheet" type="text/css" />
<script src="Home.js" type="text/javascript"></script>
</head>
<body>
<!-- Page content -->
<div id="content-header">
<div class="padding">
<h1>Welcome</h1>
</div>
</div>
<div id="content-main" class="padding">
<p>Query params: <span id="query-params"></span></p>
<p>Hash params: <span id="hash-params"></span></p>
<button id="add-query-param">Add a query param </button>
<button id="add-hash-param">Add a hash param</button>
</div>
<script>
document.querySelector('#query-params').innerHTML = window.location.search;
document.querySelector('#hash-params').innerHTML = window.location.hash;
document.querySelector('#add-query-param').onclick = function () {
window.location.href = window.location.pathname + window.location.search + '|foo=bar' + window.location.hash;
document.querySelector('#add-hash-param').onclick = function () {
window.location.href = window.location.pathname + window.location.search + window.location.hash + '|foo=bar';
</script>
</body>
</html>
And in Home.js:
// The initialize function must be run each time a new page is loaded
Office.initialize = function (reason) {
$(document).ready(function () {
app.initialize();
$('#get-data-from-selection').click(getDataFromSelection);
$('#content-main').append('<p>Office successfully initialized</p>');
So actually, this seems to work for query params, but breaks for hash parameters. I'll try using query params again in my app and see if maybe I was just goofing something else up somewhere.

Similar Messages

  • I have lightroom 5 with 5.7 updated.   I use windows.  My problem is with the spot healer or remover.  It worked perfectly when I click on it it don't have the additional circle with a line attached to it where I can move it to another place for better sa

    I have lightroom 5 with 5.7 verson updated.  I use windows.  My problem is with the spot healer or remover in the develop.  It worked perfectly for a while and then suddenly the other circle with a line attached to it where you can move it to a better spot stopped showing up.  I uninstalled the software and re installed it again but it didn't fix the problem and its still the same.  Help please.

    Does the iPod work OK?
    Does it charge when connect to the computer?
    Does it appear in My Computer?
    Look at the dock connector on the iPod. Compare with the iPod that does work/connect.
    I suspect you have a 2G iPod. Those can only go to iOS 4.2.1
    http://support.apple.com/kb/HT1353#iPod_touch_late2009
    iPod touch (3rd generation)
    iPod touch (3rd generation) features a 3.5-inch (diagonal) widescreen multi-touch display and 32 GB or 64 GB flash drive. You can browse the web with Safari and watch YouTube videos with Wi-Fi. You can also search, preview, and buy songs from the iTunes Wi-Fi Music Store on iPod touch.
    The iPod touch (3rd generation) can be distinguished from iPod touch (2nd generation) by looking at the back of the device. In the text below the engraving, look for the model number. iPod touch (2nd generation) is model A1288, and iPod touch (3rd generation) is model A1318.

  • Sorry, something went wrong - Open Office File from Search Results Page with Office Web Apps

    Hi,
    I'm getting "Sorry, something went wrong" error when I'm trying to open any office document from inside Search Results Page with Office Web Apps, the same error is appearing in the document preview as well.
    The error in SharePoint logs says that the file cannot be found.
    Please note that this error is coming only when the "Filename" of the document is not written in English (in my case its written with Arabic characters).
    If I try to open it from the document library, its opening properly with no errors.
    The only difference between two URLs (document URL in Search Results and in Document Library) is the value for "sourcedoc" attribute;
    In the case of Search Results page, the filename in "sourcedoc" attribute is kept as is with Arabic characters.
    While in the Document Library, the filename in "sourcedoc" attribute is converted into different characters (something like: "B9%D9%85%D9%8").
    Anybody have an idea on how to overcome this issue, implement a workaround or modify the "sourcedoc" behavior?
    Thanks in Advance.
    Hamza AlSughier

    Dear Wendy,
    Thanks for your efforts, I already tried your last suggestion before, but this didn't solve my problem.
    Actually my end users are accessing this portal using ADFS and HTTPS.
    Finally I got this solved, I have done below to get my overall solution working perfectly:
    - First I have configured Windows Authentication and ADFS Authentication on the same zone which is the default zone.
    - The issue when opening office documents with Arabic file name has disappeared as a result of first change.
    - Then I have faced an issue where we are not able to crawl content under Default zone, however we have to do so, after too many efforts, I found that its related to the Load-balancer/proxy, I have made the crawler server
    to crawl himself (http://CrawlServerName:PortNumber).
    - Also a change on Alternate Access Mapping was needed, I have set one of the extended zones (which is running Windows Authentication only) as Internal URL for the Default Zone, and this is was the URL I used for Crawling.
    I have configured Server Name Mappings to make sure we got proper URLs in Search Results.
    - Then we faced another issue, which is Authentication selection on login page (How to bypass this page, and authenticate using ADFS auto), I used this solution (Set Custom Sign In Page):
    http://0ut0ftheb0x.wordpress.com/2014/01/04/skip-the-authentication-selection-page-at-_logindefault-aspx-in-a-mixed-authentication-environment/.
    - I faced one more issue as a result of above workaround; Sign Out functionality wasn't working well; users get logged in automatically whenever I click on Sign Out. I solved this by modifying the "Sign Out" Control under _layouts;
    I made it to redirect users to ADFS Sign Out Page instead of SharePoint Sign Out Page (I know its not recommended, but I don't have any other option).
    Hamza AlSughier

  • I can not save an email to file using XPS Writer. I'm using Windows 7 . Works fine with Internet Explorer?

    When I try to perform this function of saving an email to file using Windows 7 XPS Writer. I receive a message stating that Firefox is not responding. XPS Writer is working using Internet Explorer?

    I've seen this error with Chrome. Are you using IE and is it updated?
    I'm a self-taught noob amateur. Please take this into account when responding to my posts or when taking advice from me.

  • Use Windows Server 2003 or 2008 with BootCamp?Just want to run basic things

    Hey, well I can get a copy of Microsoft Windows Server 2003 and 2008 with the DreamSpark program (as I am in college) for free. But my question is, is this a good idea to use with my MacBook Pro? I wasn't sure how well it'd work with Boot Camp, and all I'd want is to just run basic programs and/or games.
    Is it a good idea? And does anyone have tutorials for how to install it?

    Hi,
    Windows Server 2003 and XP 64-bit share the same codebase and XP-64bit is not supported with BootCamp.
    Windows Server 2008 and Vista 64-bit share the same codebase and Vista 64-bit is only supported with BootCamp on some Macs. See here: http://support.apple.com/kb/HT1846
    For running 'basic' things with the Server versions, why not use one of the Virtualization apps like Parallels, VMWare Fusion or VirtualBox ?
    http://www.parallels.com/products/desktop/
    http://www.vmware.com/products/fusion/
    http://www.virtualbox.org/
    VirtualBox is open-source, so you don't have to pay for it.
    Regards
    Stefan

  • Can i use windows laptop as a monitor with Final Cut Pro x

    Hi
    I'm new to mac, and so far kicking myself for taking so long to come across.
    As much as I hate my old dell xps 1647 laptop, it grates that this machine is just gathering dust.
    Is there any way to utilise the monitor when using Final Cut Pro X

    Newbie 2 mac wrote:
    …  Is there any way to utilise the monitor when using Final Cut Pro X
    you should ask Dell
    can your laptop act as a monitor, does it come with any 'video-IN' option?
    I mostly doubt ...
    Your Mac offers a standard DVI or VGA output, and allows Extended Desktop, to make use of added monitor space.
    I like to put my Events in FCPX onto a 2nd display, connected to my old MacMini2.26 …

  • How to use window.confirm in a JavaScript with unknown variables

    On my delete category page the user can pick the category it wishes to delete from a dropdown list (which is generated by rows in my database).
    When the user hits the "Delete" button ths OnClick runs a JavaScript that sends the delete request to a .jsp page that handles all my insert, update and delete queries.
    <input name="delete" type="button" id="delete" onClick="post('delete');return false;" value="Delete">
    function post(actValue)
         document.MyForm.action.value = actValue ;
         document.MyForm.submit() ;
    }So far, so good. But:
    Before the site goes to this last jsp page I want a pop-up window that ask's for a confirmation of the delete-request.
    So I changed the OnClick and I made another JavaScript::
    <input name="delete" type="button" id="delete" onClick="delete('categoryName');return false;" value="Delete">
    function deleteConfirm(categoryName)
         if( window.confirm("Are you sure you want to delete: " + categorieNaam + "?") == true)
              post('delete');
              return false;
    }The problem is, when the page is loaded, we don't know yet what category the user wants to have deleted. So categoryName is unknown.
    How can I make this work?

    You have the category in a dropdown list?
    <select name="catToDelete">
    <option value="cat1">cat1</option>
    <option value="cat2">cat2</option>
    <option value="cat3">cat3</option>
    </select>
    You can use javascript attributes such as
    var toDelete = document.all.catToDelete;
    // the value it will submit
    var selectedValue = toDelete.value;
    // the selected index
    var selectedIndex = toDelete.selectedIndex;
    // the option that is selected
    var selectedOption = toDelete.options[selectedIndex];
    // the text of that option
    var theText = selectedOption.textYou should be able to extract the info you need from that I hope.
    Cheers,
    evnafets

  • Bug found in Deploy a domain controller and member using Windows Azure Virtual Machines. With fix

    I have been working with the script found at
    http://gallery.technet.microsoft.com/scriptcenter/Deploy-a-domain-controller-2ab7d658 as a base for my azure deployments. I ran into a situation where if a VNetwork already had a DNS entry it wouldn't allow you to add another DNS entry. It would give
    an error similar to  
    Property 'DnsServersRef' cannot be found on this object. Make sure that it exists.
    This happened at line 447 of the original script.
    Line 447 looks like:
    $dnsServersRefElement = $foundVirtualNetworkSite.DnsServersRef
    I fixed the error by adding .node after $foundVirtualNetworkSite. Like this:
    $dnsServersRefElement = $foundVirtualNetworkSite.Node.DnsServersRef
    I hope that this gets fixed in the original script or that my post helps someone in the future.

    Please post comments and fixes to Gallery scripts by posting in the Gallery Q&A section for the referenced script.  THe owner of the script will be monitoring that but not this forum. Also other using the script will be alerted to your discovery.
    Here is the Q&Apage link:
    http://gallery.technet.microsoft.com/scriptcenter/Deploy-a-domain-controller-2ab7d658/view/Discussions#content
    ¯\_(ツ)_/¯

  • I use AVG and SuperAntiSpyware, neither have been detecting cookies in the past week. If I go under Privacy tab it shows cookies. What path/folder is Firefox 4.0.1 putting these cookies? I cannot find them using Windows Explorer "Search". Thanks!

    I am worried that some hack or odd software is hiding the cookies from AVG & SuperAntiSpyware. They used to detect sometimes 100+ cookies per week, now it's zero....
    Thanks again,
    dorothy

    Cookies are stored in a cookie jar and thus are shared among all open tabs and windows.
    Only all Private Browsing mode tabs/windows use a separate cookie jar that is used for all PB mode tabs.
    Note that session restore stores cookies of open tabs in the sessionstore.js file as part of stored session data.
    * http://kb.mozillazine.org/browser.sessionstore.privacy_level

  • I need to reverse the command and let the computer use Windows to search the program I want to use t

    I am not sure if you can help me.  I need to command my computer to look for a program that is most suited to open files automatically.  I accidentally check the mannual mode and appointed Adobe Reader x to be the designated program.  Now nothing will open.  How can I undo what I did last night and reverse the process to restore my original setting?

    You made Adobe Reader the default progrm for what: .pdf files, or anything else?
    "Nothing will open" means what, programs, files, any files?
    Try a System Restore to a date before you made the change.

  • Retrieving values from Database in Excel Task Pane App

    So far,
    I created a website with a database on Azure, I then published my App to Azure. My problem is that I'm not sure how I retrieve values from the database (in SQL: SELECT * FROM EXAMPLE_TABLE WHERE date = str). If someone could provide me with sample code,
    that would be amazing! :D
    It would also be very helpful if anyone knew a method to automatically update the database using information from a xml stream on another website, once a day.
    Thank you!

    Hi,
    >> My problem is that I'm not sure how I retrieve values from the database
    You can use jquery ajax call to call your webserivce or REST API, which will query the database and return a json result.
    Sample:
    Apps for Office: Create a web service using the ASP.NET Web API
    >> It would also be very helpful if anyone knew a method to automatically update the database using information from a xml stream on another website
    For the database sync-up question, I suggest you posting them on the forums like SQL Server Forum.
    Thanks for your understanding.
    Best Regards
    Lan
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Search pdf files with Windows Desktop Search

    I recently installed Windows 7 and have attemped to use Windows Desktop Search to search for text contained in pdf files without success.  Today I found a reference to Adobe PDF IFilter v6.0 at http://www.adobe.com/support/downloads/detail.jsp?ftpID=2611.  I have Acrobat 8.2.1 installed on my computer.  Since I couldn't figure out if the iFilter had already been installed, I downloaded the ifilter60.exe file.  However, when I ran this exe file I didn't see any evidence that the filter was installed.  For example, the above web page mentions a ReadMe file file which is "included with the download" but I don't know where it or the plugin can be found.  I'm still unable to search within pdf files.  Is there anything special I need to do to install this IFilter?
    Peter

    Can't help directly on the question. However, the generic problem in Windows is that the search will only delve into a list of MS denoted file types. I spent a year looking for a file I had misplaced and did not remember the name of. The following link resolved my issue and now I can search for anything in any file. I followed the registry edit in the response. Editing the registry can be dangerous and you should back up the registry at a minimum unless you know what you are doing. I also do not know if the fix is available in Windows 7. As I recall, I did find it in VISTA. Good luck if you use this, but also be careful. Bill
    http://www.winvistatips.com/search-inside-bas-and-frm-files-t570174.html

  • Setting window.location in javascript doesn't work unless i have an alert

    I am attempting to jump to a new URL from a string that I've patched together in javascript. If I just use window.location = newurlstring firefox just reloads my current page. But it I put an alert after i set the new location, then it jumps. I have a very stripped down version of what I'm trying to do at http://www.secretarea51.com/Searches/search2.htm
    That page has two buttons. Both call the same javascript function but with different parameters. One does an alert after attempting to set the new location, the other bypasses the alert. If the alert is bypassed, all that happens is the current page gets reloaded. If the alert is not bypassed, then the new page does get loaded.
    You can look at the source for the page. I've stripped it down to about the bare minimum that I could to demonstrate the problem I'm having.
    I'm sort of new to javascript, but as best as I can tell, there shouldn't be a difference between the two situations.
    == This happened ==
    Every time Firefox opened
    == ever since I've tried it

    Hmmm... It would seem as though the problem has to do with the type="submit" that I had in the input tags for the buttons. I took that out and now it does the jump with or without the alert.
    Now I've just got to find out how to make it look like a button without the type="submit" in there. But I can do that part.
    You can scratch this from the bug list or whatever this is. Maybe shift it to an oddities list or something because I still don't know why the original behavior would be different whether there's an alert or not.

  • 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

  • Window.location in AIR 1.5 Ajax

    Hi,
    Back in July I developed an AJAX AIR app in AIR 1.0. I had
    several pages in the app and used window.location to move from page
    to page.
    I just finished making a bunch of updates to the app, and
    while it works fine when I preview it using Dreamweaver CS3, once I
    publish it and load it with AIR 1.5, the window.location calls no
    longer seem to work.
    I did a bunch of looking online for resources and found
    something like this:
    function redirectURL(url)
    window.htmlLoader.load(new air.URLRequest(url));
    //window.location = url;
    Once again, this works when I preview the app in Dreamweaver
    CS3 but not when I install the app. I can't tell whether
    Dreamweaver CS3 is compiling the app in AIR 1.0 or 1.5, but I did
    download a fresh version of the extension today.
    I'm pretty much lost in terms of debugging next steps and
    would appreciate any guidance.

    Please disregard this post. It looks like the issue lies
    elsewhere. It turned out that one of my files was not bundled with
    the AIR app but Dreamweaver still loaded the file in the preview of
    the app.

Maybe you are looking for

  • Form not displayed when run- a large gray block

    I am trying to debug an existing form (which I know runs in our production enviroment). I need to debug to see what is happening to investigate the scope of a potential modification. My problem is that when I startup the OC4J container (no errors) an

  • PCP - How to simulate upcoming months payroll data

    Hi, I'm try to get plan personnel cost for the year 2008 using the payroll data of 2007. We only have the Jan-Jul 2007 payroll data in the system. I used the program RPCIPE00 with "Cost planning data" checked and "Name of payroll program" as "HTRCALC

  • Error formatting iPod

    I attempted to restore my iPod, but a message came up that said, "There was an error formatting the iPod." It didn't say anything about a disk write error or anything like that; that message was all that came up. I disconnected it and plugged it into

  • HT203167 where did my itunes playlists go?

    Help please... I went into my itunes today looking for my playlists and almost all my playlists are gone!  I have NOT done any recent upgrades, installs etc... where are my playlists and how can I restore them without having to recreate alllll my pla

  • I am getting a Firewall message that says...

    This one is for the PRO's.    I wonder if anyone can help me with this. I am getting a Firewall message that reads: The service "(Common Internet File System (CIFS))" is starting on your Mac. Application:  sbin > launchd           Port:   445 (Common