I have been thinking about this but can't figure out due to lack of familarity with how actually facebook is designed to work. If you can help and point me in right direction that would be helpful.
Problem: If you are at a group page and someone post a message you have to reload the page to see the new post. Which is annoying if it turns into chatting.
Possible solutions: that i've come up with..
extension detects new notification...somehow decide if it's about the page we are at, if yes then in background load the page get the new data and add the stuff to the page already opened. (don't know if it's even possible with the extension)
2nd idea is load after detection and confirmation just reload the page and retain all text that's been written and just scroll to that post again. I inspected the post structure it all looked randomly generated string...couldn't tell if any of the class or id were reliable to identify the textbox.
3rd idea is make new page bottom up that relies on some sort of sdk and updates pages as new post come in..(least favorable to me).
4th idea is forget about retaining the text that has been typed, if all inputs are empty and there is new notification reload the page...( i really wish reloading wasn't involved.
You can use the Javascript SDK and an AJAX post. When the server responds, if nothing extraordinary happened (no access token is expired, your facebook app is allowed), then you can handle whatever you want in the callback.
Related
I'm using asp.net webforms, so every server control generates post request on click. If I try to reload page with F5 or Ctrl+R after that request, browser by default shows re-post warning.
To avoid this behavior in IE 7-* I tried this solution: Unable to disable F5 key in IE8
But there is still warning in IE8 after post, whereas after get request all right.
How to deal with it?
You really shouldn't disable the F5 key or the browser back button as this is breaks the user mental model of how the browser works (and this is a bad thing).
The post warning is important because you really are POSTING the data back to the server (if this was after posting a record to a shopping cart) then you would submit the purchase again or add the previously added record to the database again.
It would be better to provide them with a clear and obvious way for them to get updates to the page when then require them.
A suggestion
If you just want to refresh the page to see the contents of an updated table or list or to get the latest status after the post then you could provide a button or link on the page that the user can click that preforms a AJAX get for the information that you requires and then just update the part of the screen that you need to redisplay.
You could also also do this with a SetTimeout so that the page / data updates in the background without the need for the user to click on a button or link.
Our marketing team is asking if it is possible to run a test on our site where the variations are shown based on a page exit, versus a page load. I said I could try to see if I could handle it with custom code but I would love to use something already existing. I don't have the knowledge already to trigger a page exit myself and that's what I need to find out.
Scenario: The user would load the page, GWO would decide there which variation to show on load, and when the user "exits" then variation 1 would load a popup. The popup would have a link within it and conversion would be based on the user clicking the link. An exit would be defined here as anyone leaving the domain via the back button, closing the browser, or typing in another address into the address bar. An exit here is not specifically the page but the entire domain itself. Variation 1 of the test would only be served on roughly 10 pages (our of thousands on our retail site).
I somehow think that Google Analytics defines exit already and wonder if I couldn't piggy-bank that trigger? Does GWO have something similar? I don't think it's feasible or logical for our site to track if variation 1 user leaves the domain from any point, so perhaps only tracking exit if they were served variation 1 and only from the same page they got served variation 1.
So I know that's a loaded question, but has it been before within a test? Any easy way to handle it? Thanks in advance!
First off, giving a popup when a visitor is trying to leave your site is horrible UX. It is something that absolutely everybody hates, absolutely no exceptions, period. And...trying to find out which variation of an "exit link popup" works best is like trying to find out which method of torture people like most. So my very first advice to you is I strongly recommend you push back to your Marketing team about this, they should know better...if they are actually suggesting this then maybe they need to be (re)trained (or fired...) Just sayin'...
But anyways... Ga officially states there is no auto-exit link tracking. I know that for the most part, GA determines exit links on current ping vs. next ping (or lack of), but my experience from poking at ga.js leads me to believe they do indeed to some degree have exit link / page unload tracking tucked away in there...
But rather than trying to reverse engineer ga.js to see if it's even possible to tap into something that may or may not really be there, if you have jQuery or similar framework on your page (which most sites do, and if you don't, just include it on your test page(s) easy enough), you can use jQuery's .unload() to get it to trigger as you want.
edit: One thing you said:
An exit here is not specifically the page but the entire domain itself.
Okay that's one "gotcha" that is not possible. You can write code to compare the current URL to the target URL if the visitor clicks on a link on your page, but javascript does not allow for you to access the new URL typed into the address bar, nor does it allow you to see the previous URL in the history (like if user clicks the back button) - both of these are browser security features - so there is no way for you to know 100% if the visitor is exiting your domain.
Tracking tools like GA get around this for some of their data, by having a "session" timer keep track of last activity by the visitor. If the session times out, then the last ping submitted gets the extra data for exiting your site, like "last page of visit", bounce rate numbers, etc.. (though it will not show where the visitor actually went, for reasons listed above)
I'm writing an app which should load a website. After the website is loaded, I have to fire up a 2nd command to the web page, which is kind of Javascript scriptlet.
I did this manually in my browser and in generally it seems to work fine. They way I did it manually was I created two shortcuts in my browser:
the URL to this website (e.g. http://www.example.net/123456-e.aspx)
the shortcut to a Scriptlet which calls a function on this website (e.g. javascript:__doPostBack('Video_Info1$Rating_control1$lnk_star5','')).
I first click the URL shortcut and after its loaded, I fire up the 2nd shortcut.
But how can I do this in a C# application?
But, what I'm trying to do is quite the opposite I think.
I'd like to SEND a _postBack to an existing site.
I'm not writing my own site which contains a postBack control!
Let me explain a little in detail...
the site I'm loading in my app is an existing ASPX site in the web.
In this site, you'll find several _doPostback entries and in a browser, the postBack event (when I hit it manually within a bookmark/shortcut) will be send back and has its desired result (in this case, its assigning "5 stars" to tell everybody, that something is supergood ;-).
So, what I'd like to do is to write my C# App which will send this _postBack command every time I hit the OK button or some other events.
Just as it is with my link above
"javascript:__doPostBack('Video_Info1$Rating_control1$lnk_star5','')"
This is the bookmark I have on my browsers bookmark panel - a shortcut!
.... Just to be honest, its a kind of cheat, which will do an automatic voting on an external site...
My prob is now,... how can I send this _postBack straight to the site, to increase my stars?
I am not sure what exactly you are trying to achieve, The code which you are seeing (_doPastBack(..)) is actually going to invoke a server method (code in your codebehind of that page).
You can create a webpage and have an iframe and load your first page in that.The user will be able to click on any of the button and invoke the corresponding server code if there is one attached.
<html>
<body>
<iframe src="http://www.example.net/123456-e.aspx"></iframe>
</body>
I'm sorry if this is a newbie question but I don't really know what to search for either. How do you keep content from a previous page when navigating through a web site? For example, the right side Activity/Chat bar on facebook. It doesn't appear to refresh when going to different profiles; it's not an iframe and doesn't appear to be ajax (I could be wrong).
Thanks,
I believe what you're seeing in Facebook is not actual "page loads", but clever use of AJAX or AHAH.
So ... imagine you've got a web page. It contains links. Each of those links has a "hook" -- a chunk of JavaScript that gets executed when the link gets clicked.
If your browser doesn't support JavaScript, the link works as it normally would on an old-fashioned page, and loads another page.
But if JavaScript is turned on, then instead of navigating to an HREF, the code run by the hook causes a request to be placed to a different URL that spits out just the HTML that should be used to replace a DIV that's already showing somewhere on the page.
There's still a real link in the HTML just in case JS doesn't work, so the HTML you're seeing looks as it should. Try disabling JavaScript in your browser and see how Facebook works.
Live updates like this are all over the place in Web 2.0 applications, from Facebook to Google Docs to Workflowy to Basecamp, etc. The "better" tools provide the underlying HTML links where possible so that users without JavaScript can still get full use of the applications. (This is called Progressive Enhancement or Graceful degradation, depending on your perspective.) Of course, nobody would expect Google Docs to work without JavaScript.
In the case of a chat like Facebook, you must save the entire conversation on the server side (for example in a database). Then, when the user changes the page, you can restore the state of the conversation on the server side (with PHP) or by querying your server like you do for the chat (Javascript + AJAX).
This isn't done in Javascript. It needs to be done using your back-end scripting language.
In PHP, for example, you use Sessions. The variables set by server-side scripts can be maintained on the server and tied together (between multiple requests/hits) using a cookie.
One really helpful trick is to run HTTPFox in Firefox so you can actually monitor what's happening as you browse from one page to the next. You can check out the POST/Cookies/Response tabs and watch for which web methods are being called by the AJAX-like behaviors on the page. In doing this you can generally deduce how data is flowing to and from the pages, even though you don't have access to the server side code per se.
As for the answer to your specific question, there are too many approaches to list (cookies, server side persistence such as session or database writes, a simple form POST, VIEWSTATE in .net, etc..)
You can open your last closed web-page by pressing ctrl+shift+T . Now you can save content as you like. Example: if i closed a web-page related by document sharing and now i am on travel web page. Then i press ctrl+shift+T. Now automatic my last web-page will open. This function works on Mozilla, e explorer, opera and more. Hope this answer is helpful to you.
Im hosting a rails app on heroku. It runs on the client on a touchscreen with Google Chrome in Kiosk mode, so no browser chrome or keyboard. The login/home page is different for every kiosk.
Error pages are static assets, so I'll have to do this with Javascript. If there is an error I want to display a button that will let the user get back to the home page.
I can't just use a back button script b/c of the potential for multiple errors. I thought about using localstorage to store a reference to the home page, but the error pages are served from a different domain so they wont have access.
Any ideas?
Edit:
This works in Firefox onClick="window.home();" If I set the browser's home page to that particular kiosk. But apparently isn't supported in Chrome. Is there any way to store some kind of variable that any domain can access on a per browser/kiosk basis.
I think you're making this too hard. You already have the information you need to go back stored in "local storage" -- the browser history. Simply use javascript to look at the history and go back as far as you need.
As far as returning to the home page, isn't the home page a well known URI? What's wrong with go home?
Update
Isn't the home page always going to be the first page in the history? You seem to be saying that you're in a situation where you want to return to a page for which you don't know the base URI, don't know how you got where you are, and don't know where you started.
I suppose you could put the place you'd like to go into a cookie, but if you don't even know the base URI, how would you retrieve it?
I'm beginning to think the real answer is "you need to rethink your design, there's something deeply wrong."