I have encountered a quirky problem in IE when using AngularJS (1.2.13).
The solution is in general a report-generator, which uses the routes to determine which report to show and the route parameters as the parameters for the given report.
One way to produce the exception is:
I click on a link in the menu.
Then I copy the url (from the address bar in IE).
I click on another link in the menu.
Then I paste the copied url into the address bar in IE and press enter.
This works fine, the view changes to the correct view.
Then I click on another link in the menu.
And then I paste the copied url into the address bar in IE again and
press enter.
After the final step, nothing happens, the view stays the same as it was.
If I press F5 however, it changes.
If I click on another link from the menu the solution will change to that view. Pasting the url again into the address bar, will lead to the same behaviour, nothing happens. All subsequent pastes fails, only the first one works.
This happens only in Internet Explorer (IE10), not in Chrome or FireFox.
The urls are #-based.
Tried to attach an $locationChangeSuccess and $routeChangeStart event to check what happens, but neither event is called when I paste in the url the second time.
Is there anybody who has encountered this problem before or know what is causing the behavior?
Related
When I click a button the new url will be shown in the browser address bar but strangely the content of the page is not changed . I see in the code that ..history.push(url); is executed . So what could be the problem ??
I can further narrow down the problem.
I am on a SiteA and via button click I switch to SiteC. Now if I am on SiteB and again want via button also switch to SiteC it does not work. Very strange.
I'm using ui-router.
A similar question has been asked on this a Number of times... But the solutions seem to be all over the place and either the question doesn't address a simple idea or the answer doesn't, either.
Here's my simple ui-view setup:
A master view has the navbar and footer
Children of the master view/route that can be activated include the Homepage, About Us page and Learn More page
Pretty simple...
By default, if the homepage is activated, and scrolled down 500px, and I click on a route to the "About Us" page, that page will be scrolled down 500px. Obviously this is not desired.
So... Everyone's solution is some variation of setting document.scrollTop(0) on every state change success. This is atrocious.
While it fixes the issue at hand, it clobbers the browser back button behavior. Here are some problems:
When a refresh is called, the standard browser behavior of refreshing to the current location is ruined
When the back button is clicked, the homepage would then scroll all the way to the top
If the back and forward button were clicked, I wouldn't retain the correct spot on the next page, either
This whole document.scrollTop(0) or any variation of it, really doesn't seem to be viable and I've yet to see a clear solution to this.
I have a classic dropdown menu on an Angular project with a main link always shown and a tree of sublinks shown only when hovering this one.
I have two events on the parent:
ng-mouseenter="vm.toggleDropdown($event)"
ng-mouseleave="vm.hideDropdowns($event)"
And they work perfectly fine. The main link has a simple:
ng-click="vm.navToState(item.urlState, $event)"
With a $state.go within to go to the string passed as parameter. On mobile devices, ng-mouseenter is being triggered on tap, showing the dropdown menu and this is perfect. The thing is that ng-click is being triggered too so the menu is only visible a fraction of a second before the next state loads. Is there any way to detect if ng-click is being fired by a touch event so I could add an if statement to navToState() and prevent the $state.go()? I understand that this way that main link would be unreachable in mobile but I'll take care of that adding an extra link within the dropdown.
Any other workaround for the same result is fine too.
Thanks!
Could you set a variable based on whether it is a mobile browser and use that as a check navToStart as to whether you state change or not, then have a separate state change function that doesn't care whether it's mobile or not so you can still change states in the mobile browser? That's one idea, but if it doesn't work, could be worth putting some code in your question for a reference.
Here's an answer on detecting mobile browsers:
https://stackoverflow.com/a/11381730/5349719
I've got a simple A tag:
Link Text
Every now and again IE gets confused the the link stops working. When the mouse hovering over the link, its a normal cursor, on mouse-down it changes to 'not-allowed' and on mouse-up nothing happens.
I can refresh the page and it works normal again for awhile, then it just stops working again.
How can I determine what is happening and fix it? There is no console output, there is script or events on the A tag or any of its parents. IE just borks.
This is an Angular application if it matters at all.
For clarification, I don't want any pointer changes at all, I don't want the link to randomly stop working. I just want the A tag to behave as normal. It does so in all browsers except IE.
I am hosting a WPF webbrowser control in a WPF page.The webbrowser displays a WORD document which i display using webbrowser Navigate method. Now if i make any changes to the word document and then without saving i navigate to a different page i get a WORD message saying that "The document has been modified. Do you want to save the changes?".
I do not want to display this message as we have our own way of detecting changes and prompting the user if he wants to save or not.I should also mention that when i navigate away from the page i set the browser to "about:blank" so that WORD releases the handle to the file before navigating away.
I have tried the following options but it didn't solve my problem.
wordApp.DisplayAlerts = WORD.WdAlertLevel.wdAlertsNone;
wordDoc.Saved = true;
I have a method "SetBrowserDocumentAlerts" where i have tried one of the above two mentioned options and i call it after navigating to "about:blank"
Please also note that i am not allowed to Quit the wordApp or close the wordDoc. It gives a error that this operation is not available as WORD is in use in another application.
Please suggest how i can stop the above alert message from WORD.