Providing a back link inside of a Facebook tab - javascript

I'm trying to use history.back() inside of my Facebook app to go up our site hierarchy since the browser back button is obviously useless in this sort of situation. I'm using javascript to avoid having to manage history site on the backend but it's proving to be very buggy. Clicking a link with href="javascript:history.back()"causes the page to scroll around a couple times then actually causes top to go back...
Any help with this subject is greatly appreciated.

So it turns out that history.back() is not possible due to the way Facebook hacks around with the iframes that run apps. I ended up having to implement a pseudo-back link via an implementation in the server-side framework I was using.

Related

button control on form to manipulate Web Browser control web page

I was hoping that someone could answer me a question, I don't need any code but more a helpful direction to start researching.
Here is my situation
I have a windows Form program that if I placed a button control on and a web browser control on. The web browser will have a page in it that is mostly javascript driven..now lets say thru javascipt on the web page I created a checkbox control on the webpage. Is there any way I could get my button control on my windows form to check that box? Im sorry if I am not explaining myself right still getting used to the lingo.
Thanks in advance guys
This site is a wealth of knowledge.
I assume you have WebBrowser control. Handle it's DocumentCompleted event and start you work here. Now you can work with WebBrowser.Document, WebBrowser.Document.Body to interact with your page.
For example, you can use wb.Document.InvokeScript with some parameters to handle the updates.
Or you can go directly
wb.Document.GetElementById("your_Element_ID").SetAttribute("checked", "checked")

Tracking an google analytics event in an iframe

Okay so I'm a google analytics & js noob so I know the absolute basics.
On my site http://www.wildseasonthegame.com I have some humble bundle widgets which are Iframes.
I'm still trying to understand analytics but as I understand it Theoretically I should be having a code like this
something goes here
Now my question is =
Can I replace href with iframe and will it just work? Or will i need to do other stuff (like add some extra JS) to make it work, seeing as how iframes are funny little things
Or do I wrap each iframe in its own a href with a # destination and track conversions that way?
HOw do i differentiate between clicks made to input their email and clicks to purchase?
Any other suggestions how I can track the conversion offsite. Humble bundle has an off site thank you page, but It doesnt look like it redirects back to myne, let alone guarantee tha tpeople will arrive at my page instead of closing their browser after the transaction.
If content is iFramed in you're unfortunately going to have a hard time getting any tracking on it thanks to the same-domain policy. The best way would be to add tracking code to the pages iFrame'd in... but good luck getting Humble Bundle to add your code to their pages. You can get some click tracking on it, but it'd literally just be clicks anywhere on the iFrame.

Fancybox - implementing backward and forward for iFrames

I'm using Fancybox to display webpages through an iFrame. Those webpages are like a little information network: they're calling each other via links, and the user can circle through them.
I wanted to implement back et forth buttons: I did it by putting those buttons directly inside the displayed page, and working with the history (history.go(-1)) : that works, as long as the browser behaves in the way they do with iFrames.
However, there's a problem: if the user clicks on the back button and is on the first page of his navigation, it will bring him back out of the website itself (as, out of the fancy box, it's a one-page website).
As for security purpose you cannot have access to the history and test it to avoid that, is there a way to find out if the user will get out of the domain if he does a step more? Document.referent doesn't seem to work in the context of Fancybox and iFrames…
Thanks A LOT, I tried many (mainly stupid things), including a javascript session with window.name (see how desperate I am ?) !

How to keep audio playing while navigating through pages?

I am making a website for my friends band. I would like to know if its possible (apart from using Ajax) to keep audio playing after clicking on a link to another page on the site?
I currently have it set up using Ajax to reload the content, but I am having a few issues with it, and I'd rather not deal with the bother unless I really have to.
If not possible, is there a way to minimise the disruption (pausing then playing again) while navigating? It would be possible for the new page to continue playing the track from where the last page stopped, but I would like to minimise the pause. Or, on this subject, is it possible to keep certain page elements loaded after changing the URL (without using # urls), like facebook does (as in, you click on it, but the banner never disappears during loading)
Thanks for any help :)
Use Ajax to load content and History API’s pushState() to alter URL without page reload.
For consistent behavior across browsers, consider using a wrapper library like History.js.
Sites like Facebook use JavaScript/AJAX for these kind of things. If you don't want to use it, you can use frames (not recommended). Divide the page in two frames: the player and the website itself. This way you can easily turn it off too, just open the site without frames.
Good luck!
Of course you could also pop up the player in another window/tab.
(For now) It won't be possible without frames or javascript.
It might be troublesome to implement it differently than via AJAX, however you can either use IFrames, where the music would be played in the main one and the content is displayed in the child on or you can always make it a Flash webpage.
Build it in Wordpress and use the AnythingSlider plugin to have the pages shift within the main page. This way you can have tabbed navigation and never leave the actual page. No need to write too much code. The AnythingSlider uses html for the slides.
You can also not use wordpress and just use the AnythingSlider code.
http://css-tricks.com/anythingslider-jquery-plugin/
and
http://wordpress.org/extend/plugins/anythingslider-for-wordpress/
and
http://css-tricks.com/examples/AnythingSlider/

Change browser URL and page content without reload and without using fragments

I'm well aware of the technique of using URL fragments to track state on an AJAX powered webpage, but lately I've noticed a lot of sites that are doing something similar but without fragments.
The picture viewer in the latest version of Facebook for example operates this way. The left and right navigation buttons are simple links with no fragments that when clicked change the browsers URL without doing a full page load.
Another example is GitHub's repository browser, each of the files/folders is a simple link that changes the page state and browser URL without reloading or using page fragments.
Can anyone explain, or point me to an explanation of how this works? I've done some searching, but there is so much content on using fragments that I haven't been able to find anything.
I believe this is due to the new History pushState HTML5 feature
They are using new HTML5 History API. I think this is what you want. check the menu items in this page http://tinywall.info/demos/html5-history-api/menu1.php
The tutorial to implement is right here : http://t.co/M4RvnvoQ

Categories