How to disable deeplinking in angularjs? - javascript

I am now trying to implement a page with Angularjs. But the problem is that the behaviour of the anchor element in the page seems to be overrided by Angularjs.
So for the below anchor element, I just want to present a link for the user to go to the destination.
Pay!
So I just want to direct the user to the page at payment/123. But if I click on the link now, it just try to come out with a new url by adding the link in href to the current url. Say e.g. if the current url is http://www.example.com/shopping, then it tries to direct me to http://www.example.com/shopping/#/payment/123 but not what I want (http://www.example.com/payment/123).
Any idea how I can solve this?

That was a bug with rc11 and rc12. Try 1.0.0 final.

Related

Two active links at the same time on wordpress

I have this "problem" with my website that is, when i am at the Home Page i have another link of my menu that is not a page, who stays active because i used an anchor on that link.
Basicaly i added the https://dama.ci/notre-histoire url to that link so when i'm on another page of my website i can actually click on the link and go back to the home page where the anchor is attached and this is what causes the problem.
So my question is, since that link on the menu isn't a page what could i actually do to have the link activated only when it's clicked ?
Is there another way to achieve what i'm trying to have on the website ?
If you want to check the site here is the URL
You can try with another way, you should remove current-menu-item class from that li onload using js i have added sample js code for you
$(document).ready(function() {
$(".menu-item-538").removeClass("current-menu-item current_page_item");
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
Change your “Services” link URL from:
https://dama.ci/#inspiration
to simply:
/#inspiration
i.e. remember to add your domain’s trailing slash when you use the full or root-relative URL in your links.
When you say two menu items get highlighted at the same time, you mean “inspiration” and “Home”? If yes, you’ll need to make the “Home” link point to the top of the homepage (e.g. with a URL like /#inspiration). Otherwise, it gets highlighted by your theme as the current page.

want to redirect to next page on particular section id without showing #id in the url

Can anyone help me please using javascript on the following problem.
I want to redirect to next page on particular section id without showing "#id" in the url using javascript or jquery.
Well I suppose you could store the id using HTML5 local storage then when you load the next page you can remove it and scroll the user there.
I don't recommend that you do this. It's good that the URL has the id so the user can send the URL linking directly to that section to other people.

Determine which link (on same page) was used?

I have a page with two links to an introduction/registration page. We want to show different content based on which link the user uses. They appear in different contexts on the same page, and we would like to tailor the message on the registration page to that context. For SEO purposes I was told not to change the URL.
I'm using rails. Since the incoming user will have the same referrer regardless of which link was clicked, what is the best way to know which link was used to get to my page? Is it possible in a practical way without altering the URL?
I would change the href on click like described in How to change href of <a> tag on button click through javascript
But I would not change the whole url. I would only append a parameter. This should not influence SEO.

How do I open a link to specific div in cordova application

I'm currently working on a mobile application using Cordova.
When I click on the 'reviews' button on one page, I want it to open up the next page (which shows more about that particular company) and automatically scroll down to the 'reviews' div on that page.
I've tried adding a scrollTop within the onclick function, adding a # to it (this breaks the link completely) and many other different things.
How can I do that? Any help would be greatly appreciated!
***Edit
a onclick="' + showpage + '"
this url is bring created from json info that is being brought in depending on certain criteria.
The page that it is on is a list of businesses, then if you click on the name, it goes to a page about that particular business. Currently when you click on the reviews, it also goes to the particular business but I want it to load the business page then automatically scroll down to the reviews div (This is being created dynamically as the page is loaded).
div class="star-review' <-- this is the div that I'm wanting it to scroll into position to.
Avoid href in a tag....
Use this simple workaround in JavaScript
<a id="scrollToTop name="scrollToTop" value="Send">
Scroll To Top
</a>
<script>
$("#scrollToTop").scrollTop(
$("#scrollToTop")[0].scrollHeight);
});
</script>
The href was being built into a function and then showpage was spitting that link out, I solved the problem by rebuilding the href without showpage and then I was able to add my #reviews to the end of it. :)
Cordova creates application using single page architecture, so it creates a link between page using hastag.
data-role="page" id="mypage"
In your tag you need to pass data-role as page, and you need to pass its id.
When creating link on the page, you need to write link tag as mentioned below:
My Page Link
Thanks
Amit

Linking to a page and expanding a topic with Javascript

I want to link to a page which contains multiple support topics.
When the user clicks on the link while being on an external site, the topic should be expanded as soon as the user arrives on the support page.
Example:
I link to this page
http://www.nintendo.de/NOE/de_DE/support/nintendo_ds_lite_159_142.html
Topic I want to be opened on arrival
javascript:fadeNAppearDiv('box_3_9277');
(First topic in the FAQs)
It's not clear if you are maintaining the target site (where the div will open) or not. If you don't have access to the code for that page, then there isn't any way to invoke the javascript function on it. If you can modify that page, you can do as #PhiLho suggests and modify the URL you are using to specify the DIV to open and have an onLoad handler that parses the URL and opens the appropriate DIV.
Good idea, but I don't see the question... :-)
The way I saw on some sites, like deviantART, is to use the sharp anchor notation: myURL.com/foo/page.html#TopicToExpand
JS can analyze the current URL and get the anchor part, then do whatever you need to do to highlight/jump to the right place.

Categories

Resources