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
Similar Messages
-
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>  
<span style="font-family: calibri; color: black">Search Text: </span>
<input id="tbSearch" onkeypress="if (event.keyCode == 13) document.getElementById('btnSearch').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 -
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 -
QT javascript issue - QTnext vs HREF w/ A url tags
i'm working on a site where i want to have a leader.mov that auto plays with no controllers when the page loads, then when it finishes automatically link to a 2nd movie w/ controllers that auto plays.
in the documentation it says that using an HREF param with the A<url> tag should do the same thing as a QTNEXT param. it doesn't... the A<url> tag operates no differently from a normal <url> tag, but when you click the movie it does load the controllers and scale attributes that i set with E<params> in the HREF tag. if i try to use the QTNEXT instead of HREF the movie loads perfectly but it ignores the E<params> and doesn't give me controllers.
right now i've got it working by using a QTNEXT that specifies a movie, and then i have an E<autohref=true> set in addition to the <url> and then an HREF with the params i want. and it appears to be executing the qtnext changes the autohref to true, and then hits the href and jumps to it, properly executing the param changes.
this just doesn't seem like the best way to go about this, and i haven't tested cross platform yet...
any body got any ideas?
also, here's my code - i'm using the AC_quicktime.js file provided by apple for embedding QTmovs
QT_WriteOBJECT('inc/leader.mov' , '640', '95%','', 'autoplay','true', 'controller','false','scale','aspect', 'qtnext1','<leader.mov> T<myself> E<autohref=true>', 'href','A<Teaser.mov> T<myself> E<scale=aspect autoplay=true controller=true>');i got the documentation from apple's dev site for QT:
https://developer.apple.com/referencelibrary/QuickTime/idxScripting-date.html
specifically the first doc "html scripting" page 25 (pdf) -
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. -
Problem with location.href
hi
I want to create a widget but got a problem with a link. This is the html code.
<body>
<input type="text" id="temporaryinbox_textbox">
<select id="language">
<option value="">en</option>
<option value="de/">de</option>
<option value="es/">es</option>
<option value="it/">it</option>
</select>
<input type="submit" value="Check" onclick="location.href = 'http://www.temporaryinbox.com/' + document.getElementById('language').value + 'inbox.php?inbox=' + document.getElementById('temporaryinbox_textbox').value;">
<input type="submit" value="Random email" onclick="createRandomEmail();">
<input type="text" id="temporaryinbox_textbox2" size="25" onclick="document.getElementById('temporaryinbox_textbox2').select();">
</body>
On Windows with Firefox it works but on OS X as a widget it loads the target in to the widget. How can I make load it into a new Safari window? Or set it, that the default browser will be used….
Thanks for your help
iMac Intel 17" Mac OS X (10.4.6)Hi Samira,
DI has by nature some constraints, one is its memory leaks another one is the time of instanciation... I can keep going with some others like memeory consumption and not thread safe.
Servers technologhies are, starting by the historical one DI-Server and its companion which is B1WS and finishing by one which is the way to go: B1if (you can call scenario as web services).
What I meant by implementing a connection's cache mechanism, is to limit the number of connections and deconnections (the main issue with DI-API), but definitively I would try to go outside of this... But this is my personal point.
Regards,
Eric -
CRM 2013 - Inconsistent javascript issue crash the web client and user needs to reopen
Hello,
We are using CRM 2013 on premise version and almost 600 users are using it. We have some inconsistent JavaScript issue (following is the log for same) which happens to users in a day or two. When this issue occurs user can not work in system and they have
to open new instance of CRM.
Does anybody knows about this error?
<CrmScriptErrorReport>
<ReportVersion>1.0</ReportVersion>
<ScriptErrorDetails>
<Message>Unable to get property 'location' of undefined or null reference</Message>
<Line>1</Line>
<URL>/_static/_common/scripts/main.js?ver=1676323357</URL>
<PageURL>/main.aspx#313155368</PageURL>
<Function>anonymous($p0,$p1,$p2){this.$3_3.get_currentIFrame()&&Mscrm.PerformanceTracing.write("Unload",this.$3_3.get_currentIFrame().src);this.$H_3=$p0.toString();this.$26_3();this.$1A_3();this.$1J_3();if($p0.get_isLocalServer())$p0.get_query()["pagemode"]="iframe</Function>
<CallStack>
<Function>anonymous($p0,$p1,$p2){this.$3_3.get_currentIFrame()&&Mscrm.PerformanceTracing.write("Unload",this.$3_3.get_currentIFrame().src);this.$H_3=$p0.toString();this.$26_3();this.$1A_3();this.$1J_3();if($p0.get_isLocalServer())$p0.get_query()["pagemode"]="iframe";addPassiveAuthParameters($p0);var$v_0=$p0.toString();if(IsNull($p2))$p2=false;var$v_1=this.$18_3($p0,$p2);if($v_1){if(this.$2z_3()){window.location.reload();return}this.$2d_3();this.$1s_3();Mscrm.PerformanceTracing.write("Navigate",$v_0);!Mscrm.Utilities.isIE()&&this.raiseEvent(Mscrm.ScriptEvents.UpdateTopLocation,null);this.$3_3.get_currentIFrame().contentWindow.location.replace($v_0)}else{this.$10_3();var$v_2=this.get_contentWindow().Sys.Application.findComponent("crmPageManager");if($v_2){!Mscrm.Utilities.isIE()&&$v_2.raiseEvent(Mscrm.ScriptEvents.UpdateTopLocation,null);var$v_3={};$v_3["sourceUri"]=Mscrm.Utilities.getContentUrl(null);$v_2.raiseEvent(Mscrm.ScriptEvents.IFrameReactivated,$v_3)}}window.self.InnerIFrameSrcChangeTimestamp=(newDate).getTime();this.title=$p1;if(window.LOCID_UI_DIR==="RTL"&&$p0.toString().indexOf("PersonalWall")>=0&&window.UseTabletExperience)this.$3_3.get_currentIFrame().style.position="RELATIVE"}</Function>
</CallStack>
</ScriptErrorDetails>
<ClientInformation>
<BrowserUserAgent>Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3)</BrowserUserAgent>
<BrowserLanguage>en-US</BrowserLanguage>
<SystemLanguage>en-US</SystemLanguage>
<UserLanguage>en-US</UserLanguage>
<ScreenResolution>1366x768</ScreenResolution>
<ClientName>Web</ClientName>
<ClientTime>2015-04-20T15:41:12</ClientTime>
</ClientInformation>
<ServerInformation>
<OrgLanguage>1033</OrgLanguage>
<OrgCulture>1033</OrgCulture>
<UserLanguage>1033</UserLanguage>
<UserCulture>1033</UserCulture>
<OrgID>{E8BBA7AE-A552-DE11-B475-001E0B4882E2}</OrgID>
<UserID>{614837CD-448B-DE11-A5E1-005056970D6C}</UserID>
<CRMVersion>6.1.2.112</CRMVersion>
</ServerInformation>
</CrmScriptErrorReport>Are you on-premise, or on-line? : It's on-premise
Can you reproduce it on-demand, or is it sporadic?: It's sporadic
There is a mention of loading an iFrame in the error, do you have iFrames on the form that generates this error?
It's not on specific forms, so can't identify that. Yes we have iframes on some forms.
Does it happen on any/all entity forms, or specific ones? Do the entity forms have any custom JavaScript on them?
It's not on specific forms. And yes we have javascript on almost all forms.
Do you have any network problems or slowness in your network? Does the problem happen when the network is busy?
We need to check this on next occurrence.
Do the users that see this error have any unusual add-ins or toolbars in their browser? This is not for specific user. Its happening for all randomly.
Have you tried other browsers like Chrome or FireFox and do users see the problem there as well?
We need to check only for IE. -
On upgrading to FireFox 4 from 3.6.15, I noticed that my capability.policy.default items in the prefs.js file were no longer working (the custom site that I run locally needs access to this attribute, amongst others) - how can I go about returning this feature back on?
Example CAPS entry:
user_pref("capability.policy.default.Location.href", "allAccess");
I've had to downgrade again to 3.6.15 until I can get this to work.
Tested on Windows XP (SP3), and using existing/new profiles in FF 4.0 and using prefs.js and user.js - nothing can get the Javascript code to read the location.href and getting an error generated in the error console.
Also tested on Mac OS X 10.6.7 with FF 4.0 - still no luck getting capability.policies to work.
Please help...I've been beating my head against this problem for a few hours, and I finally solved it. I'd been trying to set a capability policy using the "magic" default policy, and nothing would work - I could disable properties and functions of the Window object, but not the Location object.
It turns out that if I set a custom policy name, and named the specific sites I wanted the policy to apply to, it works! The only hitch is that you'll have to build a whitelist of sites that are allowed to have this kind of access, instead of allowing any site to access it by default. I think this is prudent security policy, in order to prevent XSS attacks.
So, for your case, instead of this:
user_pref("capability.policy.default.Location.href", "allAccess");
use this instead:
user_pref("capability.policy.policynames", "hrefaccess");
user_pref("capability.policy.hrefaccess.sites", "http://example.com http://www.example.com");
user_pref("capability.policy.hrefaccess.Location.href", "allAccess");
I haven't tested this code, but a similar implementation for my problem did the trick. I hope this helps! -
Location.href not working in firefox. Is there any alternative script for that?
window. location.href not working when i try to submit an ajax form.
I am a programmer. This code works on all browser except firefox.
Any solution for this? or any alternative code for location.href?A good place to ask advice about web development is at the mozillaZine "Web Development/Standards Evangelism" forum.
*http://forums.mozillazine.org/viewforum.php?f=25
The helpers at that forum are more knowledgeable about web development issues.<br>
You need to register at the mozillaZine forum site in order to post at that forum. -
Javascript error calling a bi 7.0 webapplication from a bsp application
Hi everyone,
This is the scenario we're facing a javascript error :
Enterprise Portal is calling a custom bsp application ( via an iview in the enterprise portal ) in the bi system with a parameter "template_id" and a value, which is the technical name of a bi web application.
The bsp application is evaluating the parameter by some custom code and creating a html page with a redirect or a maintenance message to the bi web application passed with the parameter "template_id".
The html link to the bi web application is created according to this documentation :
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/46/03d4ac801467e6e10000000a1553f6/content.htm
Purpose of the bsp application :
in the bi system there is a database table to maintain a flag for each webtemplate and infocube, which should not be called via the enterprise portal for a certain time ( some kind of maintenance switch ). The bsp application then decides to show a maintenance page for the called webtemplate or to send the redirect page to the client.
The process described above is :
working with the bi 7.01 sp7 in the bi ( enterprise portal sp22 ) in the productive system.
working in the Q&A system bi 7.01 sp8 with bi 3.5 web applications.
not working in the Q&A system bi 7.01 sp8 with bi 7.0 web applications.
The javascript error calling bi 7.0 web applications is :
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Win64; x64; Trident/4.0; .NET CLR 2.0.50727; SLCC2; .NET4.0C; .NET4.0E)
Timestamp: Mon, 6 Jun 2011 09:11:04 UTC
Message: Object doesn't support this property or method
Line: 96
Char: 11
Code: 0
URI: https://mlptb1.mlp-ag.com:58001/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex?TEMPLATE=B_221_002_KUNDEN_POSTEN_AD
We've opened a message. Support center is saying that this method isn't supported by sap. We should ommit the bsp application and the used functionality.
Is there any way to find out, what is causing this object is missing ?
Is there another way than a bsp application to use this custom maintenance function in the described system setup ?
system components :
production system
SAP NetWeaver 7.0 Portal SP22
SAP BI 7.01 SP 7
q&a system
SAP NetWeaver 7.0 Portal SP22
SAP BI 7.01 SP 8
Kind regards.
DirkHello everyone,
we did some further analysis on this problem und we think we found the problem.
The error occurs while trying to execute the standard url for web templates inside a Enterprise Portal Frame, for example
https://XXX:XXX/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fcom.sap.ip.bi.bex?TEMPLATE=XXX
While executing the URL a HTML-Page with some embeded Javascript-code is sent back to the browser.
In this Javascrip-Code, the method-call "dsmObj.registerAll" leads to a script error in Internet Explorer.
dsmObj.registerAll("pcd:portal_content/com.sap.pct/platform_add_ons/com.sap.ip.bi/iViews/com.sap.ip.bi.bex", "GUSID:6FC9SuhGDPIMMLwOdeHEIg--_7WQud13yeLJDz2kYoQFSg--", "1307605928212");
In SP7, the method "dsmObj.registerFullKey" is called instead of "dsmObj.registerAll". This has changed in SP8.
dsmObj.registerFullKey("GUSID:iBPvyska9*xE_JBalkQG2g--YyKv2C3NToP0I79Mw7EO8w--", "1307606479963");
The object "dsmObj" seems to reference the parent frame of the Enterprise Portal.
Has anyone seen this before? Any ideas how we can fix this?
Kind regards,
Matthias
Edited by: Matthias Keller on Jun 9, 2011 2:07 PM -
Anyone else having issues with location services since the 7.1 update? Ever since I updated i’ve been seeing the location services icon on my status bar at all times. I noticed that google was the app that was using it a lot, but after I turned the feature off for google my phone started using the “traffic”, “frequent locations” and “cell network search”. When I turn the feature off for all of those things it’s no longer a problem. So just wondering if anyone else is having this issue or if anyone has a solution?
The "solution" is probably to increase your knowledge. You've done good things. Perhaps this article will educate you a bit more about location services.
Basically, they can be very useful, but can cause a lot of iPhone use. A major example is "Remind me to ... when I leave home."
http://support.apple.com/kb/HT5594 -
Stock Transport order issueing storage location determination
Folks,
In case of a Stock transport order scenario in which plant A with SLOC1 delivery to plant B with SLOC 2. Is there any option how the issueing storage location can be determined? The delivering plant can be determined through the special procurement key but there is no option for the issueing SLOC.
Regards,
MdZHey Karen!
I am not sure if I understand your problem correctly.
You do not want the system to create a new MARD entry when postin goods issue.
You can enable/ disable this function with transaction OMB3 in the customizing.
have fun
Flo -
Issue Storage Location in Components details Subcontracting PO
Hi all
I need to implement this process in SAP:
I have to send material X, from storage location B 'broken', to my supplier for repairing. After He has repaired it I post good recipe of material X in the storage location A 'adjusted'.
I plan material X through MRP at plant level only for storage location A.
In the material master I've set procurement type 'F' and Special Procurement '30'.
I created a recursive BOM for material X where I entered, for component X, B as issue storage location.
In this way MRP run (with '1' as value of 'Create PR' parameter) creates subcontracting PR with X as material to buy and X as component to send to vendor, but in the detail of component I have the storage location field kept empty.
This for me is a problem.
In fact when I create PO from this PR automatically through ME59 transaction, the System creates a requirement at plant level for component X.
But this requirement is for broken material and has to be covered by stock in storage location B.
I know that is not easy to understand all the details of this process, even due to my english, but I hope someone can help my.
Please if you need a clear up, ask me.
Thanks for your help
Yours faithfully
Paolo VerderioHi Paolo,
don't worry. Your explanation is well understandable.
I cannot advise how to fix the problem with the missing storage location. I just have some doubts that it is the right approach to distinguish between an boken and a repaired material by storage location. Even for stock valuation there is certainly a difference between both, that you can't make transparent by storage location, and also if you look at your available stocks.
I would recommend to have either different materials or different valuation types. I have to confess that I am not sure that valuation types would help for your subcontracting PO.
best regards,
Udo -
Purchase Order - Issue storage location set mandatory entry
Hello All,
When create subcontracting PO, want to set the field of Issue storage location as mandatory.
I tried to find configuration "Materials Management>Purchasing>Purchase Order-->Define Screen Layout at Document Level", but there is not entry "Issue storage location" to set the screen layout field.
I searched previous threads, but only find some to mention issue storage location for STO. Now, I just use subcontracting PO that is same as NB document type.
Please your kind suggestion or any method to set Issue storage location as mandatory in PO.
Thanks very much!
MagHi ,
Please, could you re-check it again, I have found storage location and issue storage location fields under define fields for fields selection group.
Under Field selection group NBF Purchase order
Selection group supplying plant
Issue storage location required entry chose
Under Field selection group NBF Purchase order
Selection group Basic data item
Storage location required entry chose
After this setting, I can be find this storage location fields as Mandatory.
Regards,
Thiru
Maybe you are looking for
-
Why wont my iphone connect to the internet
My iphone won't connect to the internet. I have called sprint and have tried the rest and nothing works.
-
Outlook doesn't always play sounds
I have the latest office 365 + win8.1 and outlook doesn't play sounds all the time. It seems to play sounds after I have gone through the advanced settings and told it where the reminder.wav file but if I reboot my PC the sounds are gone again. there
-
I would like to delete mail from all my Apple devices in one go rather than having to access each individually and then read/delete on each, is this possible? I have a Mac Book Pro an iPad mini and an iPhone 5. Any help would be gratefully received.
-
Troubles testing first Web Dynpro ABAP in IE6
Hi people. I'm having some troubles testing standar web dynpro in IE, service wait service stay idle, like in this [screen cap|http://personales.ciudad.com.ar/kakon/ie.JPG]... But... when i try to see same service in firefox, works fine like in this
-
Is anyone else having trouble downloading the iPhone Update 4.2.8?
I got my new iPhone4 on 6/28. I have it attached to my iTune account and during the synch the software is attempting to update (4.2.6 to 4.2.8). I accept the T&C and the download starts and takes between 6 and 8 minutes. Just before it completes I