Yasir Khan
Yasir Khan

Reputation: 520

how to jump to specific text or paragraph

Ho do I make a link to specific text or paragraph in a page. I can't use id or anchor name cause Its external web page so I can't edit it.

i.e.

<a href="#But also the leap">This is the link I want to use</a>

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centurie.

But also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

Upvotes: 2

Views: 343

Answers (1)

Daniel Beck
Daniel Beck

Reputation: 21475

Unless the target page already contains anchor tags or element IDs that match what you want, what you want to do is not possible without cooperation from the recipient page -- you'll have no way to either determine the desired scroll position or to set it in the linked site.

The same-origin policy restricts how a document or script loaded from one origin can interact with a resource from another origin. It is a critical security mechanism for isolating potentially malicious documents.

https://developer.mozilla.org/en-US/docs/Web/Security/Same-origin_policy

Upvotes: 4

Related Questions