Javascript for redirect - receipt page
I was on support with BC and they asked me to post this to see if someone could find something missing in the code.
I found this script on a BC forum page and added it to my RECEIPT PAGE so that the site will redirect after a purchase to the original URL as opposed to worldsecuresystems.
http://kb.worldsecuresystems.com/598/bc_598.html#main_Returning_a_customer_to_a_default_UR L_after_viewing_the_receipt_page
Only, it doesn't work.
<script>
var siteUrl = 'http://www.yoursite.com';
var links = document.getElementsByTagName('A');
for (i = 0; i < links.length; i++)
if (links[i].getAttribute('href'))
var href = links[i].getAttribute('href');
if (href.substring(0,4) != 'http' && href.substring(0,1) == '/')
//this example requires your links to have absolute paths.
//document-relative paths and absolute URLs are not supported.
links[i].setAttribute('href', siteUrl + href);
</script>
here is a link to my site: www.chaserbrand.com and the the code on the page:
<script>
var siteUrl = 'http://chaserbrand.com';
var links = document.getElementsByTagName('A');
for (i = 0; i < links.length; i++)
if (links[i].getAttribute('href'))
var href = links[i].getAttribute('href');
if (href.substring(0,4) != 'http' && href.substring(0,1) == '/')
//this example requires your links to have absolute paths.
//document-relative paths and absolute URLs are not supported.
links[i].setAttribute('href', siteUrl + href);
</script>
Ah, OK, sorry for the misunderstanding. So when a field is clicked you want to launch a URL with the field's name as a URL parameter?
If so, then you use something like this as the field's MouseUp event:
onFieldMouseUp();
And then put this code as a doc-level script:
function onFieldMouseUp() {
app.launchURL("http://www.example.com/"+event.target.name);
And you can use a simple loop to apply the code to all of the fields in your file.
Similar Messages
-
How do I stop firefox from redirecting every page I click on in Google search? No matter what I search for in Google when I click on it Firefox redirects me to some other search, sales, or contest page. I have a security program running, no maleware, adware, or virus on my pc. Thanks for the help in advance.
Sounds like a dose of search redirect malware or a redirect virus.
Install, update, and run these programs in this order. They are listed in order of efficacy.<br />'''''(Not all programs detect the same Malware, so you may need to run them all to solve your problem.)''''' <br />These programs are all free for personal use, but some have limited functionality in the "free mode" - but those are features you really don't need to find and remove the problem that you have.<br />
''Note: If your Malware infection is bad enough and you are mis-directed to URL's other than what is posted, you may have to use a different PC to download these programs and use a USB stick to transfer them to the afflicted PC.''
Malwarebytes' Anti-Malware - [http://www.malwarebytes.org/mbam.php] <br />
SuperAntispyware - [http://www.superantispyware.com/] <br />
AdAware - [http://www.lavasoftusa.com/software/adaware/] <br />
Spybot Search & Destroy - [http://www.safer-networking.org/en/index.html] <br />
Windows Defender: Home Page - [http://www.microsoft.com/windows/products/winfamily/defender/default.mspx]<br />
Also, if you have a search engine re-direct problem, see this:<br />
http://deletemalware.blogspot.com/2010/02/remove-google-redirect-virus.html
If these don't find it or can't clear it, post in one of these forums for specialized malware removal help: <br />
[http://www.spywarewarrior.com/index.php] <br />
[http://forum.aumha.org/] <br />
[http://www.spywareinfoforum.com/] <br />
[http://bleepingcomputer.com] -
How can I convert iWeb page to html with NO javascript for email campaign?
I have a holiday greeting I made in iWeb '09 for my business. The service I'm using to use to manage my mailing list wants me to strip all javascript code from the page so it is not seen as spam when it is emailed.
How can I convert the page made in iWeb to an html page with no javascript?
ThanksHow can I convert the page made in iWeb to an html page with no javascript?
You cannot. There will be nothing left. iWeb pages rely a lot on JavaScript.
Use a template from Mail.app. Or create such template. These are simple TABLES and have no JavaScript in it.
Do Cmd-Shift-G in the finder and type :
/Library/Application Support/Apple/Mail/Stationery/Apple/Contents/Resources/
Open one of the folders and open each successive folder until you see files like Picnic.mailstationery.
Right-click to show the package content.
Then navigate thru Contents, Resources until you see the files and images you need.
Edit them to your hearts content.
Double-click the file Picnic.mailstationery and it will open in Mail.app for further processing. -
Hi, I'm making hyperlinks. They work for the main page of the webpage, but when I'm trying to redirect the hyperlink to a "sub page" of the webpage it is still going to the main page. (allthough I'm pasting the complete url address)
Hi! first of all, thank you so much for your help.
I don't know about that panel you are talking about.
what I do is RIGHT CLICK, INTERACTIVE, NEW HYPERLINK, and a window pops up, where I paste the address (images).
Where says URL I paste the complete address that the "sub page" gives me.
Is that correct? (for the main page of the wabepage works correctly)
thanks!!! -
The JavaScript for this page failed to load correctly. Always on shutterfly.
I'm trying to view photo albums on shutterfly and always get the following error. "The JavaScript for this page failed to load correctly. "
Howdy there JohnB,
It sounds like you are unable to access your Shuttefly due to a JavaScript issue in Safari. I would start by checking to see if JavaScript is enabled in the Preferences.
Enable JavaScript
JavaScript is a software technology that allows some buttons, online forms, and other webpage content to work properly. To block JavaScript, deselect this checkbox.
Note: Disabling JavaScript can cause many sites not to work properly.
From: Safari 6 (OS X Mountain Lion): Security preferences
http://support.apple.com/kb/PH11886
Thank you for using Apple Support Communities.
All the very best,
Sterling -
The JavaScript for this page failed to load correctly
I keep getting this message "The JavaScript for this page failed to load correctly" when I try to access my Shutterfly accounts.
This is a new problem since upgrading to Mavericks. It does not happen on my Macbook Pro running Mavericks.
JohnHowdy there JohnB,
It sounds like you are unable to access your Shuttefly due to a JavaScript issue in Safari. I would start by checking to see if JavaScript is enabled in the Preferences.
Enable JavaScript
JavaScript is a software technology that allows some buttons, online forms, and other webpage content to work properly. To block JavaScript, deselect this checkbox.
Note: Disabling JavaScript can cause many sites not to work properly.
From: Safari 6 (OS X Mountain Lion): Security preferences
http://support.apple.com/kb/PH11886
Thank you for using Apple Support Communities.
All the very best,
Sterling -
Mobile PO Receipt: Page showing To Sub and To Loc for Standard Receipt
Hi,
I am facing a weird issue.
Using Oracle WMS R12.1.1
I have 2 different OU's and 2 different responsibilities. I have approved PO's for each OUs. Receipt Routing is Standard Receipts for both POs. When I do receipts using Mobile PO Receipt Page for OU 1, after specifying LPN number and hitting enter, it shows To Sub and To Loc fields. These fields are not mandatory and don't show while doiing Receipts for OU2 POs using the same Mobile PO Receipt Page. Has anyone faced this issue? If so could you please share your resolution?
Regards,
ManojManoj,
I assume it is the same item used in the both the PO's. Can you confirm?
Also check whether there is form personalization on the mobile page.
Karthik. -
Safari: 27 min for loading Web page (JavaScript issue)
I have Safari running on Mac OS 10.7.1 (MacBook Pro). It works fine, except for some Web pages. For example, <http://www.heise.de/newsticker/meldung/Erster-Kratzer-fuer-Kryptoalgorithmus-AES -1324532.html> gets loaded partly, then it takes minutes to have it completely on my screen (even the text).
In order to depict it, I started the Web inspector and put a screenshot of it for download.
As you can see, there are some JavaScript parts that gets interpreted as streams. This is what causes Safari to show a high latancy, up to 7 minutes. The whole page mentioned above took 27.1 minutes to load. The actual problem is that some parts that apparently are required to complete the page are loaded after some latency.
Switching off Safari Extensions, clearing the cache, and temporarily removing files in "/Library/Internet Plug-Ins" and "~/Library/Internet Plug-Ins" did not show any effect.
On the other side, Firefox 6 (on the same machine) does not have this issue. Its web console complains about "illegal characters", but the page gets completely loaded within fractions of a second.
Any ideas?The issue has been solved in the meanwhile. The problem was that I had NetBarrier X5 running in the background with Banners Filter switched on. Obviously this caused the massive delay in loading some Web pages with ads in it.
-
Javascript for Alert in OAF Page
Hi,
I wanted a popup Error to be thrown like the ones using js in client side validations
I had posted a thread earlier
Re: Javascript for alert
has anyone tried the js alert option and can you post the code and exact details of how it needs to be done?I have not worked in js earlier.
Also would want to know how to call this js to throw this error message and the risks of doing this.
Thanks,Hi,
Try this...
StringBuffer jsString = new StringBuffer();
jsString.append(" function validatePage() { ");
jsString.append(" var alertMsg = ''; ");
jsString.append(" var view = document.getElementById('ContractEV'); ");
jsString.append(" var contractNo = document.getElementById('ContractNo'); ");
jsString.append(" var customerRef = document.getElementById('CustomerRef'); ");
jsString.append(" var projectNo = document.getElementById('ProjectNo'); ");
jsString.append(" if(contractNo.value == '' && projectNo.value == '' && customerRef.value == '') { alert('Please select Contract Number, Customer Reference or Project Number'); return false;} ");
jsString.append(" if(contractNo.value == '' && customerRef.value == '' && projectNo.value != '') { return true; } ");
jsString.append(" if((customerRef.value != '' || contractNo.value != '') && projectNo.value == '') { if(!view.value) { alert('Please select View you want to see for Contract'); return false;} ");
jsString.append(" else { return true; } } ");
jsString.append(" } ");
OABodyBean bB = (OABodyBean)pageContext.getRootWebBean();
bB.setOnClick(jsString.toString());
pageContext.putJavaScriptFunction("validatePage", jsString.toString());
OASubmitButtonBean okButton = (OASubmitButtonBean)webBean.findChildRecursive("OK");
okButton.setOnClick("return validatePage()"); -
How to redirect the page to home after alert message in APEX
Hi All,
I have 4 tab and home page APEX report in that home page I have organization to select as parameter for all the page which is mandatory column so without select the organization in home page I can move to other 4 page but some time users directly pressing the tab for this I have create the ORG_ALERT in each 4 page which this we are able to see the pop-up message when we directly hitting on tab but after select the OK to alert message the page is run for long time and it show all the organization data which I don't want so how can I modify the alert so that after pop-up message it will go to home page.
Declare Output VARCHAR2 (20);
begin
Output := 1;
Output := NVL( :AI_ORGANIZATION_ID , 0);
IF Output = '0' THEN
APEX_UTIL.SET_SESSION_STATE('AI_ORGANIZATION_CODE','');
HTP.p ('<script type="text/javascript">');
HTP.p ('alert("No Organization selected.\n Please select an Organization");' );
HTP.p ('</script>');
END IF;
END;
Regards,
SushantHi Kiran,
I have created two process -- On Load - After Header
1) Sequence=10
Declare Output VARCHAR2 (20);
begin
Output := 1;
Output := NVL( :AI_ORGANIZATION_ID , 0);
IF Output = '0' THEN
APEX_UTIL.SET_SESSION_STATE('AI_ORGANIZATION_CODE','');
HTP.p ('<script type="text/javascript">');
HTP.p ('alert("No Organization selected.\n Please select an Organization");' );
HTP.p ('</script>');
END IF;
END;
2) Sequence=20
Declare Output VARCHAR2 (20);
begin
Output := 1;
Output := NVL( :AI_ORGANIZATION_ID , 0);
IF Output = '0' THEN
htp.init;
owa_util.redirect_url('f?p=&APP_ID.:1:&APP_SESSION.');
ELSE
htp.init;
owa_util.redirect_url('f?p=&APP_ID.:4:&APP_SESSION.');
END IF;
END;
but after click on tab directly it is not showing the pop-up message and directly going to home page. I want when I click on pop-up message to OK then it need to redirect the home page also from home page when I am selecting any organization and trying to go on tab it is not going maybe due to owa_util.redirect_url. Please advise.
Regards,
Sushant -
Javascript Disabled Redirect?
Background:
I am using IIS 5 with Microsoft Access DB. Im coding
ASP/Javascript.
I currently have a login.asp page which handles Username and
Password Authentication. No Javascript functions are on this page.
I do have a script that detects if their browser has javascript
disabled.
i.e.
<noscript><p><span style="color:#FFFFFF;
font-weight:bold; padding:2px; background-color:#FF0000">This
site requires javascript to be enabled.<br />If you do not
enable javascript in your browser settings, some functions will not
work properly.</span></p></noscript>
</div>
This is all fine and dandy but it doest affect the user from
proceeding once they put in their username and password. Once they
are authenticated, the user is redirected to a index.asp page.
After my login.asp page, I have several pages within my site
which I do use javascript for some of my functions.
So, how do I prevent my user from proceeding past my
login.asp page if their browser has javascript disabled.
I thought of changing my login.asp to have the NOSCRIPT tag
to have a redirect to another login1.asp page, but if a malicious
attacker looked at the source page of login.asp, it would no how to
bypass my NOSCRIPT redirect tage and go straight into my login1.asp
page thus still enable them to login in with javascript disabled.
Should I recode my login page to use a javascript function
before continuing? if so what would you suggest?
Thanks in advance.>And that's my whole point: JS yes - for additional
features or to
>improve the usability, but not a requirement to make the
site work.
Yes, I agree 100%. The problem is that in most cases by
providing the extra
functionality, you automatically make the site reliant on it.
Either that or
the user experience is crap because the site appears to be
broken. I think
you really have to decide to go with JS or not go with JS and
adhere to your
choice throughout the entire site.
"Michael Fesser" <[email protected]> wrote in message
news:[email protected]...
> .oO(Pat Shaw)
>
>>Sometimes, for certain functionality, there is no
alternative but to use
>>Javascript Michael.
>
> IMHO most really important things can also be done with
server-side
> scripts if JS is not available. It will often be much
slower and more
> complex, but it's possible. I'm not talking about such
stuff like "Spry"
> effects, scrolling or fading images and such - these are
only eye candy.
> If they are not there, the site can still work. It's the
most basic
> functionality of a site that shouldn't entirely rely on
JS, because
> there's always a non-JS alternative (at least I haven't
seen anything
> yet that would not have been possible in a similar way
without JS).
>
>>If you need that sort of functionality then you MUST
use
>>Javascript. Besides, there are plenty of very large
and established sites
>>that make good use of Javascript. If you write off
Javascript then you
>>also
>>write off related technologies such as AJAX.
>
> No question, AJAX can make many things much more
convenient and easier
> to use, but after all it just sends another request to
the server and
> fetches some data. Nothing special. Server-side scripts
could often do
> the same work and already deliver the final page.
>
> Take for example some map services like Google Maps
(even if this is a
> rather bad example). It's quite common to use AJAX
techniques, so the
> user is able to seamlessly drag the whole map around,
while the script
> automatically loads the next required tiles in the
background. Quite
> nice of course. But this is nothing that would really
require JS. The
> better services also provide a non-JS alternative - you
just have to
> click a link to move the map one or more tiles in any
direction. Then
> the server sends the new page back. Not as nice and
convenient as the
> JS-version, but still completely usable.
>
> And that's my whole point: JS yes - for additional
features or to
> improve the usability, but not a requirement to make the
site work.
>
> YMMV.
>
> Micha -
Javascript for multiple date fields
Hi all-
I have to write javascript for 15 different date fields in a form.
The requirement here is that we convert all date fields on Page 100 from date pickers (editable date fields) to display-only date fields with two controls for the users to set the date.
If the field is empty (no date registered yet), there will be a green checkmark(X). When the user clicks this checkmark, the current date is entered into the field.
If the field is not empty (there is a date already in the system), there will be a red X. When the user click this red X, the date from the date field is removed.
The javascript I am using here is
</script>
<script type="text/javascript">
function init(){
var datePickerVal = $v2('P100_TODAYS_DATE');
if(datePickerVal){
$x_Show('ToggleDateR');
$x_Hide('ToggleDateG');
}else{
$x_Hide('ToggleDateR');
$x_Show('ToggleDateG');
function toggleDateFunc(pValue){
var sysDate = $v2('P100_DATE');
if(pValue == 'R'){
$x_Hide('ToggleDateR');
$x_Show('ToggleDateG');
$x_Value('P100_TODAYS_DATE','');
}else if(pValue == 'G'){
$x_Show('ToggleDateR');
$x_Hide('ToggleDateG');
$x_Value('P100_TODAYS_DATE',sysDate);
window.onload = init;
</script>
This javascript is working for one date field( 'P100_TODAYS_DATE') but i have 15 different date fields in this page(100) all should have same funtionality. Please help me out how to write a logic to use this function for all the date fields.
Thanks,(apex 3.2)
Greenhorn
Edited by: Greenhorn on Jul 19, 2011 12:30 PMHi,
You can do the needful by re-using the code if you can give the item names as P8_DATE1, P8_DATE_hh1, P8_DATE2, P8_DATEhh2 etc..So your item name just differs by a sequence.
Now you write function which will return desired date value taking above items as input. Pass item names to this function, get session state using APEX_UTIL.GET_SESSION_STATE('item_name') API.
Now modify you code as
FOR i IN 1..30
LOOP
v_date_array[i] = f_get_date('P8_DATE'||i, 'P8_DATEhh'||i);
END LOOP;
....Now you have all date valus in array. Just write one update as follows
UPDATE TABLE1
SET date1 = my_date_array[1], date2 = my_date_array[2]..
WHERE ....Hope it helps :)
Cheers,
Hari -
How can i redirect a page to Login screen when sessionis timeout???
I have a problem in my portal development.
I set the "<b>Session timeout= 01</b>" parameter in the<b> Visual Administrator</b>
server_0 > services > Web Container
Runtime > sap.com/irj > irj (view button)
However, when the session is timeout then the page become to be "red"!!! That is, there is an Exception. I'd like to redirect the page to the "Login screen", but I don't know how. <b>Does anybody know how can I do it</b>?
Thanks in advance.Hi,
the http session invalidation must be checked at application level do it DYNPAGE only .you can call the following method.
public void expireSession(IPortalComponentRequest request)
long lastAccessedTime=request.getServletRequest().getSession().getLastAccessedTime();
Date currentDate = new Date();
Calendar currentDateCal = new GregorianCalendar();
currentDateCal.setTime(currentDate);
long systemTime = currentDateCal.getTimeInMillis();
long sessionExpiryTime = systemTime - lastAccessedTime;
long sessionExpiryTimeProp = 600000; //dont hard code.get from property file
if(sessionExpiryTime >= sessionExpiryTimeProp)
try
IPortalComponentResponse response=(IPortalComponentResponse)this.getResponse();
String sessionExpiryPage ="/irj/servlet/prt/portal/prtroot/com.sap.portal.masthead.LogOutComponent?logout_submit=true";
response.write ("<script language="javascript">");
response.write("parent.window.location.replace('"+sessionExpiryPage+"','','toolbar:No,status: No,location: N0');");
response.write("</script>");
}catch(Exception e) -
Page Spawning - Prompting For Number Of Pages
I asked a similar question a few years back and at the time, the project went by the wayside. Well, the project is back on track and now I'm in a jam and need to use some javascript for some easy automation. Here's the situation. I have a form with a hidden button that allows persons who know where the button is, to spawn the current semplate into additional pages, while renaming the approzimately 400+ form fields on each page. As it currently stands, the user needs to click the hidden button each time to spawn a new page. This is kind of cumbersome considering, I need to generate approximately 200 pages at a time. Here is the current code (culled from any of a number of web pages) that works for the single click page addition:
// Get a template object from an existing template
var t = getTemplate("temp1");
// Spawn the template on the page following this one, and rename the fields
t.spawn({nPage: pageNum + 1, bRename: true, bOverlay: false});
What I'd like to do is have the button "click" (mouse up) produce a dialog box that asks the user to input the number of pages needed to be spawned. I'm not concerned about page numbering as I have a separate means for doing that, once all the pages have been spawned. Clearly, I am not a javascript programmer, so, if someone is willing to help, it's going to have to be usable code that will require only minor tinkering, if any. Any help or ideas would be greatly appreciated. I'm using Acrobat Pro X. There was an MVP named George Johnson who tried to help me back them, but quite honestly, Is imply didn't know how to tie it all together. He suggested using the following code in generating the dialog box (obviously, text is not geared toward my document). Can someone show me how to tie all of this together?
var cResponse = app.response({
cQuestion: "How are you today?",
cTitle: "Your Health Status",
cDefault: "Fine",
cLabel: "Response:"
if (cResponse == null)
app.alert("Thanks for trying anyway.");
else
app.alert("You responded, \""+cResponse+"\", to the health "
+ "question.",3);
Thank you in advance,
RandyGreetings George!
A while back, you assisted me with the following code (see below), which was used to spawn a multi-page document. By the way, the code was just what the doctor ordered, thank you! I am now faced with another issue while spawning this document. I have one field (show_num) which I need to prevent from renaming, when the document is spawned. All other fields, rename perfectly, as desired. I now will be utilizing this show_num field, which was previously just a place holder and not used. Is there a way to have the field remain the same name as the pages are spawned? In other words, I'm looking to have the user type a "show number" on the first page and have it immediately populate in the same field on all pages (i.e. 1026-022). This number would then populate on all pages in the "show_num" field. Here's the code I'm using to spawn the pages:
var resp = app.response({
cQuestion: "How many pages to you want to add?",
cTitle: "Enter number of pages to add",
cDefault: "1",
cLabel: "Pages:"
// Get a reference to the template to spawn
var t = getTemplate("temp1");
// Only proceed if user enteres a value,
// that can be converted to a number,
// and the number is at least 1 and no more than 600
if (resp && !isNaN(+resp) && +resp >= 1 && +resp <= 600) {
// Round number of pages to nearest integer
var num = Math.round(+resp);
// Spawn the specified number of pages
for (var i = 0; i < num; i += 1) {
if (i === 0) {
var oXO = t.spawn({nPage: numPages, bRename: true, bOverlay: false});
} else {
t.spawn({nPage: numPages, bRename: true, bOverlay: false, oXObject: oXO});
// Delete the button
removeField("P" + (numPages - 1) + ".temp1.spawnPage");
} else {
app.alert("You entered an invalid number: " + resp); -
Help with embedding Javascript for Lightbox Photo Gallery in Muse!
Hi all:
I am fairly new to Muse and I have been having trouble finding relevant information for embedding Javascript in order to get a lightbox to work in Muse. Would anyone be able to walk me through embedding the Javascript for the Lightbox Photogallery for Picasa in Muse?
This is the code I want to use: Lightbox Photo Gallery and Slideshow for Picasa
And this is the look I am trying to accomplish within my Muse site: Cycling Around The World / January 2006 / Picasa Template by www.paulvanroekel.nl
Any help would be appreciate. Thanks much,
AlexisHi,
I have tried inserting the script that you have pasted above as HTML on my test site and it worked.
What happens is whenever you insert something as HTML, Muse by default creates a div tag and places the content within the div tag. What I have done differently is I have inserted the JS with in the <script> tag and it has inserted the Javascript in this manner,
I beleive that since this a browser re-direct script that you are using, you would like to place this in the head section and not in the body tag, however, that is certainly not possible using Muse as it does not allow access to the code it generates as a muse file.
You, can still export the pages as HTML and make the appropriate changes there before uploading to the server.
Hope that helps.
Regards,
Maybe you are looking for
-
Can't scan over the network after clean windows 8 install
My wife's hard drive recently crashed (it was Windows 7 32bit). I replaced the drive and installed Windows 8 64bit, and then upgraded to 8.1. I did the 8.1 update before I installed any software (i.e., canon drivers). Everything seems to work fine
-
I have been getting the tritone sound at 2 :17 pm every day for a while now with no message or notification to back it up , I think this has been a long term problem since 2009 according to your past discussions , so has anyone solved this problem y
-
Has anyone tried this?
-
Got an error when applying oil paint filter
I'm using Photoshop CS6 on a PC. When I tried to apply the oil pain filter, I got an error message saying "The filter you were using encountered an unknown graphics processor error that caused an unexpected exit. Check the manufacturer's website for
-
IPhone Code vergessen; Zurücksetzen geht nicht weil "Mein iPhone suchen" aktiviert ist
hallo ich habe gestern meinen code neu eigestellt und danach vergessen. Ich wollte dann, nach mehreren gescheiterten versuchen, mein iPhone per itunes zurücksetzen aber das geht nicht, weil auf meinem handy "mein iphone suchen" aktiviert ist. Was sol