This is the script for a webpage with a GO TO MOBILE SITE button. When the button is clicked I want it to go to the mobile site.
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function goMobile() {
window.open("mobile.dudamobile.com/site/syedasadiq");
}
</script>
</head>
<body>
<input type="submit" value="Go to mobile site" onclick="goMobile()" />
</body>
</html>
I'm certain that I've done everything correctly, but when I click the button on my browser it prodoces an error message saying: "Cannot find ...:/Users/AbdurRasheed/Desktop/mobile.dudamobil... Make sure path or Internet address is correct."
I think that the computer is registering my mobile URL as a file and not a website address, but I do not know for sure. Either way, how do I fix this problem?
Thanks in advance.
Use window.location.href = "http://mobile.dudamobile.com/site/syedasadiq".
Related
I am practicing with Microsoft Dynamics CRM 2013 using REST 0Data endpoint with Web Resources.I have added an Iframe in case form and assigned a pagein the IFRAME URL and wrote the code snippet given on Microsoft Website
Now when I open a case from CRM Sales dashboard to check this IFRAME, it showing different errors in different browsers
in Chrome it display the text of the page but gives below error repeatedly
Sandbox access violation: Blocked a frame at
"https://diecho.crm5.dynamics.com" from accessing a frame at
"https://diecho.crm5.dynamics.com". The frame being accessed is
sandboxed and lacks the "allow-same-origin" flag.
in Firefox it display the text and when I open the Only Iframe code in different tab it gives below error in console
NetworkError: 404 Not Found -
https://diecho.crm5.dynamics.com//ClientGlobalContext.js.aspx"
Error: Context is not available. { throw new Error("Context is not available."); }
NetworkError: 404 Not Found -
https://s3-eu-west-1.amazonaws.com/987fsdr3e47f993ofskljd9/zone1-1003.js
in IE8 it gives below error:
This content cannot be displayed in a frame To help protect the
security of information you enter into this website, the publisher of
this content does not allow it to be displayed in a frame.
Please Help me
How to fix these errors?
What am I missing to enable on CRM or on Browser side to see the page in IFRAME?
In the Form Editor double click the iframe and make sure that the "Restrict cross-frame scripting, where supported." option is not checked.
Since you are accessing OData from HTML page, Xrm.Page.Context will throw you an error. In place of that you should use parent.Xrm.Page.Context.
Tested the same code as MSDN and it worked successfully.
<html><head>
<title>JQuery REST Data Operations</title>
<script src="../gap_jscript/jquery.min.js" type="text/javascript"></script>
<script src="../gap_jscript/SDK.JQuery.js" type="text/javascript"></script>
<script src="../gap_jscript/json2.js" type="text/javascript"></script>
<script src="../gap_jscript/TestODATAExample.js" type="text/javascript"></script>
<script src="../ClientGlobalContext.js.aspx" type="text/javascript"></script>
<meta charset="utf-8">
</head>
<body style="font-family: Segoe UI; background-color: white;">
<button title="Click this button to start the sample." id="start">Start</button>
<button title="Click this button to reset the sample." disabled="disabled" id="reset">Reset</button>
<ol id="output">
</ol>
</body>
</html>
My Firefox add-on opens Fancybox (type: "iframe") from a content script (page-mod). In the Fancybox I show my own HTML page (my_fancybox_stuff.html) that is located in my own server.
Now, from the my_fancybox_stuff.js (javascript of my_fancybox_stuff.html), can I send a message to the add-on's main.js? Or to the content script that opened the Fancybox?
I was hoping the global 'self' object to be accessible from my_fancybox_stuff.js as it is accessible from the content script that opened the Fancybox.
I am interested to hear about any potential workarounds to get this done.
In Chrome extension this is trivial. In my_fancybox_stuff.js I can call chrome.extension.sendMessage() and it works.
Thanks in advance!
EDIT: Adding some code to clarify my case. Simplified the code to save folks' time on reading it. This is simple as hello world.
From the contents_scipt.js (injected with page-mod) I call:
$.fancybox.open(
{
// Some irrelevant Fancybox options hidden for clarity
href:"http://www.mysite.com/my_fancybox_stuff.html
type: 'iframe'
}
);
my_fancybox_stuff.html would look something like this:
<!doctype html>
<head>
<meta charset="utf-8">
<title></title>
<script src="js/jquery.js"></script>
<script src="js/my_fancybox_stuff.js"></script>
</head>
<body>
<div id="my-wrapper">
<div id="my-form-div">
<form id="my-form" action="#">
<div>
<div><p>Name</p></div>
<div><input id="fullname" type="text" name="fullname" value=""></div>
</div>
<div>
<div><p><a id="my-button" href="#">Press this</a></p></div>
</div>
</form>
</div>
</div>
</body>
In my_fancybox_stuff.js, when button ("my_button") is pressed, I want to send out a message containing the value of the input field ("fullname") and listen it in content_script.js.
Yes, your my_fancybox_stuff.js can communicate with your add-on's content script using postMessage ().
See the documentation and examples at MDN.
I have an iframe of a website let name it foo.com what happen is that if the visitors click on the iframe on my website what happen now is that it will right away open a new window
The iframe is a video embed....
So I just want to find out would it be possible if I want to have an option like a popup window alert to tell the visitors by clicking this it will open a new page and if they click confirm will open new window direct to foo.com home page but if click on cancel then it will just stay in the same page [my page]
Just want to know if this is possible.
I not sure if the following will help.
Try:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
function gosomewhere(){
var yes = confirm("Would you like to go to this webpage?");
location.replace("http://www.foo.com");
}
//-->
</SCRIPT>
</head>
<body>
Click Me
</body>
</html>
Let me know if it is ok
I have an asp.net page with a grid. On RowDateBound event
mybutton.Attributes.Add("onclick", "javascript:window.showModalDialog('some.aspx?ID="
+ mybutton.CommandArgument +
"','window.self','dialogWidth:800px; dialogHeight:800px;center:yes; status:yes; scroll:no; help:no');");
on some.aspx page I have dropdowns and asp.net button that does a postback.On postback the some.aspx page opens again in a new window (Browser).
How to prevent this?
I appreciate your support.
I've had this problem before with ASP.NET and a ModalDialog. What you need to do is set the <base target="_self"> tag in the head of the page. It sounds too simple to be correct but it's what fixed it for me.
This frustrated me quite a bit.
If you need any help with this, just ask.
<html>
<head>
<title>My Page</title>
<base target="_self">
</head>
<body>
<!-- Your content -->
</body>
</html>
You can place a return false; behind the link / button to stop the post back from happening.
I have one page from which i have to redirect to a page which is in some other application or can say in other domain.I want waiting screen till the page is loaded.I want to do it by jquery.Can any one help me-
blockUI would be an option
eg.
<html>
<head>
<meta http-equiv="refresh" content="3; URL=http://www.mydestination.com/">
<!-- script include for jQuery and blockUI -->
</head>
<body>
<script type="text/javascript">
$(document).ready(function() {
$.blockUI({
message: 'redirecting'
});
});
</script>
</body>
</html>
but if you want to keep the overlay on the redirected page while it is loaded, this would be only possible if you use eg. an iframe. but with that, you would have other problems eg. height, width of iframe