How to use angular routing for directly access to content - javascript

how can i use Angular routing to access clickable content ( appears when click on a specific tab) when insert URL directly in browser?
for example I have a menu when i click on first tab some content apear and when click on another tab show something else and url was change but when I insert that url directly in the address bar, the content does not show. how can i solve this problem ?

Are you getting a 404 when putting the url directly in the browser address bar?
If so, it sounds like you need to configure your web server to route all requests to the page AngularJS loads from. AngularJS routing will then take over and load the content as expected.

Related

X frame option Deny Alternative

I have added a setting that my project URL will never be loaded in an iframe by adding a header
response.setHeader("X-Frame-Options", "deny");
this is working fine but on the Iframe page , i just see a broken image saying refuse to connect with URL. Is it possible if i want to show some specific message with this kind of request or the URL will automatically open in a separate tab rather then the Iframe as we don't wan't customer to view this look and feel.

How can I save a page in AngularJS

Im playing with Angular Tabs.
I Include one url property in my model so I can work with ng-include="tab.url" and display a diferent page for each tab. (is same page just different parameter for tab)
But doesnt make sense download the content every time the user click on the tab.
Is there a way I can save the page to save the content locally so only get the page from the server once?
You could load the templates directly into $templateCache. Angular will automatically check this whenever you specify a template src with ng-include before attempting to retrieve your template from a remote location.

Url pr0blem, unable to retrieve ?tema=79 after page loads in address bar

http://fb.9nty.com/?t=Outrage+ShopRite&l=www.learnmoreng.com/forum2_theme_111582910.xhtml?tema=79
I use a Facebook share plugin to share links, but after links is shared and been click upon, the browser opens the page ignoring ?tema=79
Is there any ways to help?
I would want to use this: http://fb.9nty.com/?t=Outrage+ShopRite&l=www.learnmoreng.com/forum2_theme_111582910.xhtml&tema=79
And implementing a code that automatically changes &tema to ?tema and reloads the page
url encode the link (the part after &l=) - so the share link becomes:
http://fb.9nty.com/?t=Outrage+ShopRite&l=www.learnmoreng.com%2Fforum2_theme_111582910.xhtml%3Ftema%3D79

Open fancybox with url of page in address bar

I have stucked somewhere please have a look and get back to me if you have some idea on that:
I want to open a page in fancybox and url of page which is opened in fancybox should display in address bar. I dont want to display url with http://abc.com#divid it should be a proper url without #divid.
It should be something like that :
http://exanple.com/title1
here is my html code:
<a id="example1" href="general.php">Recent Trip to New York</a>
jQuery code:
$("a#example1").fancybox();
Is there any way I can implement the things like I have mentioned..
URL in the browser can be manipulated with HTML5 history, but in this case it would not be advised as the user is simply viewing another page via an iframe, and they remain on the parent page.
Mozilla Developers: Manipulating The Browser History

Link to a page within Facebook iframe

Im looking for a way to link to a webpage within a facebook iframe page
so
http://www.facebook.com/designmystyle/app_244351832329915
would be something like
http://www.facebook.com/designmystyle/app_244351832329915?http://www.lickmystyle.com/contact/
I have tried the method here http://www.codingforums.com/archive/index.php/t-85547.html using
<script type="text/javascript">
<!--
function loadIframe(){
if (location.search.length > 0){
url = unescape(location.search.substring(1))
window.frames["app_runner4f84331f0576e6f73380702"].location=url
}
}
onload=loadI
frame
//-->
Im unsure if app_runner4f84331f0576e6f73380702 is the name or the id of the iframe but it was the only one I could find that had a width of 810px by 800px
Any ideas on if this could be done would be great
If it's a facebook canvas app then the url for it should be of apps.facebook.com and not www.facebook.com.
Any querystring parameter that will be added to your canvas app url will be then passed by facebook to your app by adding it to the url of your app when loaded inside the canvas iframe, so if you direct the user to:
apps.facebook.com/app-name?param=value
facebook will POST the app canvas iframe to:
www.yourdomain.com/canvas-path?param=value
Then you can get that parameter like any other GET parameter and what you want with it.
One thing though, if that parameter is a url then it should be url encoded, other wise things will go wrong.
What I don't understand is what you're trying to do with the url that you want to pass as a parameter, what is this "app_runner4f84331f0576e6f73380702"?
Edit
Oh, it's a page tab, sorry, I missed that part.
I'v never used it before, but it says in the last section (Integrating with Facebook APIs) of the Page Tab Tutorial:
your app will also receive a string parameter called app_data as part
of signed_request if an app_data parameter was set in the original
query string in the URL your tab is loaded on. For the Shop Now link
above, that could look like this:
"http://www.facebook.com/YourPage?v=app_1234567890&app_data=any_string_here".
You can use that to customize the content you render if you control
the generation of the link.
From what I understand, this is exactly what you need in order to get the data.
How ever, you won't be able to change the url of the iframe the way you posted since you have no access to the parent window (your page is on different domain than of facebook, and the browser will prevent it due to the cross-domain policy).
What you can do how ever is just:
document.location.href = URL;
You are in your own page, doesn't matter that it resides in an iframe.
The thing is that you don't need all of that, just be aware in the server side of the parameter that is passed to you from facebook (from the query string) if such exists, and render the page according to that.
There's no reason to render a page that then redirects the page to another url, when you already know what the user wants, you're just making the user make a redundant round trip to your server for nothing.

Categories

Resources