I've tried to implement a menu bar which doesn't reload the page but modify the url in the browser and also display the data using ajax.
Somehow using HTML5 history api i've achieved this:
http://tinywall.info/demos/html5-history-api/menu1.php
When i checked this in IE9, it is reloading the page. As i googled, it was specified IE9- doesn't support html5 history api. But when i tried Google Plus in IE9, the navigation menu is getting the ajax content as well as changing the url. Is there any other concept to achieve this??..
Google Plus is probably using location.hash and onhashchange instead of changing the full URL.
HTML5 objects , attributes are not yet draft yet, it is scheduled to get its final version till 2024 and first draft at the end of 2012 .
Browser compatibility is the common issue in HTML5 you can add the attributes to the page by using the js, but object behavior depend on the browser itself so you have to wait for the newer version of ie (compatible one J). As per now there is no workaround
Related
I have been trying to implement a functionality when the page refreshes. I figured that value of
window.performance.navigation.type
turns 1 if the page reloads else, it is 0. I created an alert message on page load and the values are correct for IE and Firefox but it remains "0" for Chrome throughout no matter how many times the page reloads. I have also tried windows.onbeforeunload as per other stackoverflow answers but nothing seems to work!
How do I resolve this?
OR
Is there another way to detect a page reload that works on all the browsers?
Thanks!
As of 2017-11-01, Chrome (61.0.3163.100) does support the performance.navigation API. See this gist for some sample code that you can throw into a page and see it working.
I cannot find the Chromium ticket tracking the development, but this Chromium blog post links to the W3 spec that defines the performance.navigation API, so perhaps it was supported fully in a recent release.
According to the docs, the Performance.navigation property returns a PerformanceNavigation object.
Checking the browsers compatibility at the bottom of the page you can see that chrome is not supported.
I have a Jquery mobile app that became completely broken on iOS the moment I add offline support via an application cache manifest as described here:
https://github.com/jquery/jquery-mobile/issues/6494
There is lots of discussion about this but I have yet to find a clear answer as to whether I can have offline support on mobile safari and preserve the nice looking transitions of Jquery Mobile.
Can it be done?
I finally got it working. This was what I did:
Apply prefilter as per Using the Application Cache
change any href="#" to href="index.html"
change any dialog("close") to $.mobile.changePage('index.html')
The only weirdness remains is that in order for it to work offline the app must be launched twice after being added to the home screen.
I am trying to make a web page which allows users to drag and drop images into Microsoft Office applications, specifically Powerpoint.
By default (as of FF3.5), Firefox will insert the source URL when an image is dropped rather than the image itself. After adding the following Javascript/jQuery code (derived from https://developer.mozilla.org/En/DragDrop/Drag_Operations),
$('img').attr('draggable', true).bind('dragstart', function (event) {
event.originalEvent.dataTransfer.effectAllowed = 'copy';
});
dragging and dropping works from Firefox to Word and Excel, but not to PowerPoint. For an example of what happens, see http://slides.html5rocks.com/#drag-and-drop. I have tested this with FF3.6 and FF9.
How can I make it work with PowerPoint?
Just drag'n'drop outside the boundaries of the ppt slide (to make sure you're not dropping on a predefined textbox) - and release the mouse button -no coding needed!
Firefox drag will drop the image at the center of te ppt slide.
Status quo
Sadly there is nothing you can do from within your browser and the application to enable drop support for PowerPoint.
This is something that needs to supported at source level in PowerPoint (and it seem to be if you don't drop the image on an existing element but right outside the slide frame you want to drop it onto - but probably depending on version).
If it (for some reason still) does not support the image part of the drop but just the link (and if there is no option provided for changing this behavior) there is little to do but to hope Microsoft will update PowerPoint with this support in the future, - or - check the following options for work-arounds if needed:
Add-ins
You can look into writing an add-in (or possibly just use a macro - you might need to lower security to medium [PDF] for macros) for PowerPoint that will take the link that is dropped and replace it with the image the link refers to.
Here is one place to get you started making add-ins if this is a viable option.
Here is a commercial framework that makes creating add-ins very simple.
(disclaimer in this regard: I am here assuming this will be possible due to add-ins such as this which allow you to show a live web page inside PP).
Pipe-line / work process
There is also the option of injecting a third-party applications in the pipe-line to do screen snapshots of the image and have it inserted automatically into PP.
SnagIt is such an application (and there are probably others) and it has free extensions that will allow you to integrate "snags" directly with PowerPoint.
Or (the perhaps too obvious option): simply copy the image in browser and paste it into PowerPoint.
What is your version of Powerpoint?
It's very important because image format support may be lacking.
If that's the case your code needs a minimum version warning addition.
Could also ask to convert image to suitable format.
It may even be the case that it's impossible to the version of Powerpoint you're using to support this in the way you want.
You could try to use html code.
This code might help you:
http://classroomtech.org.uk/2008/08/drag-and-drop-in-powerpoint/
Other possibilities are OLE object with a link to a image.
Could check how other Microsoft applications, that do something similar, handle things.
If that doesn't work you could try to generate an OLE object with a link to the image in it.
I've been working on a project using the hashbang (#!) method to skip though pages. Basically there is only 1 page, and when you click to go to a diffrent page, you stay on the page, but the URL changes, e.g. from index.html#home to index.html#about and new content is loaded via AJAX/JSON. All works well, but if I go "back" (or forward) in the browser, only the page in the URL changes, but my jQuery isn't fired to reload the content.
What I need is some code that will handle both the back and forward actions in all browsers, so that I can fire the function to load the page from jQuery. How do I do this?
Why reinvent the wheel? History.js is a great & well-maintained jQuery plugin that supports the new HTML5 History API and falls back gracefully to using hash URLs instead when the History API isn't supported. Works in just about every browser (even IE 6).
Take a look at the hashchange event. It fires when the hash is changed. However, you should only do this for Internet Explorer 8 support.
Internet Explorer 7 does not support hashchange, so you can't rely on that. As for Internet Explorer 9, it (along with Chrome, Safari and Firefox, of course) supports the History API, which you should be using instead. It keeps your URLs clear, short and semantic, while enabling elegant Back/Forward button support.
There is a jQuery-Plugin that seems to be doing exactly what you want.
http://www.asual.com/jquery/address/
It was the highest voted answer for the questing What is the best back button jQuery plugin?
I'm trying to find the best approach not to break the back button in my javascript application.
In my research I'm trying to see what the state of the art is. So I turned to google maps to see how it works.
It does have back/forward functionality, but it doesn't change the url when generating a new history entry. Try to go to http://maps.google.com/, type NY and press enter. Now use the back button. No url change.
How do they do this? I tried to figure it out but I have a hard time wading through outdated documentation about javascript history and IE6 tips.
Create a new history entry:
location.hash = 'new_history_entry';
Creating no history entry:
location.replace('http://no/new/history/entry');
Google maps is using frames. To verify it, run HttpFox. You'll get a HTML page with javascript in it.
You can analyse it on your own, or just believe me that it works with frames.
Lekensteyn's answer will not add the back/forward buttons in IE6, you need a frame for that. jQuery History uses the onhashchange event if the browser supports it (all modern browsers do) if not it will add the appropriate backwards support needed (ie6 needs iframes, firefox 1, ie7 etc just need interval checks).
Something like YUI Browser History Manager will do it