Universal Analytics Tracking is Preventing Anchor Link From Working - html

I'm working on an email, and the writer wants the link to go directly to a video on a page. This video is in a tab, and lower on the page.
I set up an anchor to go to the video, but once Universal Analytics tracking has been added to the URL, the anchor link no longer works.
Works:
Link Text
Loads Page Without Going to Anchor:
Link Text
Is there anything I can do to get the anchor link to work properly?

I think the URL is a bit malformed in the second example (it may work but it's not what you mean to be accessing necessarily)
Try using:
http://www.foo.com/page-name/?tabset0=1&utm_source=foo-source&utm_medium=foo-medium&utm_content=foo-content&utm_campaign=foo-campaign#anchor-name
Fragment identifiers / anchor (as you refer to it) are supposed to be given at the end (the very end) of the address-- if you put it in the middle of the query it won't be passed correctly. In fact, fragment identifiers aren't given to the server. Only the client gets those... the CGI query is definitely given to the server.
Here's some more info: https://en.wikipedia.org/wiki/Fragment_identifier

Related

Link is removing Http header

I am trying to do a simple thing , navigate to an external url
Class Books
However I am getting a 404 because the Http// portion is being deleted I am not sure if this is an mvc thing or html thing. Here is link http://18.217.228.108/angularapp1.
Here is a link to a screen shot of me accessing url
https://gyazo.com/455b01f1ceded24f9b4ce6c58b0e10e1
Curious-programmer,
You must navigate using an absolute URL just when it is out of your domain such as https://www.amazon.com/
However, I've noticed that you are trying to navegate to a link inside your own domain using absolute URL when you must use relative URL like:
Class Books
Try
Anchor Test
and then try keying http://18.217.228.108/angularapp1/book/ into your browser url.
The link you are using is actually 404.
Based on the link given in updated question:
The new link you've given is an html page (which you can navigate to in the "normal way"). It links to an angular app with an anchor "Books". Clicking on "Books", whilst attaching "book/" to the url in the browser (the url you're trying to link to in your original question), is intercepted by the script and actually navigates to:
http://13.59.126.130/BuellerWebApi_deploy/api/book/getAll
which returns a Json object containing data to display on the same page.
(Your concern about the removal of the http:// in the anchor is a red-herring (try navigating to http://www.bbc.com - you will see www.bbc.com in the browser url). It's the way your app has been configured.)
So, as things stand, navigating to the anchor in your original question, whilst appearing to be a valid url, actually is not. Its a 404.

Facebook, StaticHTML and form summission

This is weird!
I have set up a form using RapidMailer, and on an external site it works fine. (Just to complicate matters, the form is within a <div> as I display a background image, and then use the <div> to position the signup box halfway down the page)
But ...
Put it within an Facebook (Thunderpenny) StaticHTML page, (which I think is <iframe>?) and whilst I can enter name/email, and the submit button shows mouse up/mouse down events, it just won't submit.
I tried adding "pointer-event:auto" to the div so that it was to the fore, but no go. And no good asking the app creator as I doubt I'll get a response. Anyone any ideas? (** I could include page code, but it's 90% links to external js files Rapidmailer sets up)
Is it 'cos I got a <div> within an <iframe>? Do I need to add an <object> to the code somewhere???
It turns out that for some reason, the HTML code cannot find / use the javascripts even with direct URL's. I strongly suspect it's to do with "cross browser" limitations. In otherwords, the StaticHTML <iframe> is on one server, and the HTML code is trying to access javascript on a second server. And as the RapidMailer script is using three scripts direct from jquery.com, it's difficult to know what can be eliminated as they all contain error trapping routines.
In the end, I had to add a direct link to a status update on the Facebook page, and redirect it to the signup form on my blog. I then pinned the post the top. Alas, now for some reason it won't display a graphic with the link, and instead insists on showing the URL itself! Oh well!

Web browser Automation Selecting a Link

Is it possible to click on a random <a> from a loaded HTML document in embedded webBrowser in my form? I'm using VB.net
I'm in a spot of bother. I've managed to get the Webbrowser to navigate to the page I want to be on, now i want it to invoke with page elements.
This is where it gets odd ok, sorry.
I have a rich text box of urls (these URLS are user inputted and match the links on the page I've already navigated to.)
I'd like to select a url at random from the richtextbox (up holds up to 10 lines) then find the href= on the page and invoke the <a>
Is this possible?
If I understand correctly, you have the webBrowser control with the current page loaded, and you want to select from the textbox a link to navigate to.
So you have the WebBrowser.Document.Body.InnerHtml property where you have the HTML of the loaded document, so i guess you can search that to match the input from your text box and with the url from the href call the Navigate method.
Hope that helps
WebBrowser.Document doesn't provide good Intellisense, but you have the full range of dom functions available to you at this point... (eg. getElementsByTag(string); )

what is the #! sign in the url what does it mean? [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
What is it when a link has a pound “#” sign in it
i saw the #! sign in the url
like :
http://www.google.jo/#!
but i dont know what is it mean?
i know that
this
http://www.foo.com#bar
is used to link an element in the page .
but what about ! character
It's called a URL HASH and is used for in-page bookmarking. It is now also used to maintain page state in AJAX applications. Anything after the # can easily be parsed and re-written without forcing a page reload, allowing the JavaScript code to load/hide/show page elements based on the developer's choosing.
It is called a hash, and it is used to denote an anchor in the page. Basically when the page loads it will seek out the anchor and scroll the page to it.
http://www.google.jo/#hl=ar&source=hp
<div>content</div>
<div id="hl-ar">scroll here</div>
<div>content</div>
Traditionally, the # was used in URLs to tell the browser to jump to an anchor in the page with the name following the #.
In modern AJAX applications, it allows modification of the location bar URL without the page needing to reload, allowing the Back button on the browser to move back through AJAX state, as well as bookmarking of AJAX pages.
# in the url acts like a goto statement. ie move to a particular section of the same page.
Besides that it is also used by applications that heavily use ajax to render the larger part of the website without refreshing the page (ie the page doesn't refresh but a considerable amount of html is requested from the server using ajax giving an impression that an entire page is loaded).
These apps face a problem that when the users click on the back or refresh button in the browser, it may not show them the correct page because there is no refresh happening. So a work around is applied by appending the history information to the url separated by #. And when the user clicks on refresh or back button, this information is used to take them to the correct page. There is a jquery plugin available that does this.
Also recently I came across this doc from google that explains how to make ajax applications 'crawlable' by using #! in the url
(#) is a hash sign.
It's used to indicate named parts of a page which allow the website to link to not just a page, but a particular part of it.

How to scroll programmatically to a position in a page to display desired content (as opposed to display the top of the page)

I see on some website (like StackOverflow, yahoo, the US Homeland Security department, ...) a word associated to a link that, when clicked, not only loads a page, but also, displays that page at the exact location where the contain related to the word starts.
How can I obtain that with ASP.NET MVC? (by the way, do I need javascript for that?)
Thanks for helping
Go to the other content
<a name="jumpHere">Some content</a>
Also the URL can have /yourpage.html#jumpHere or with variables, /yourpage.html?var1=foo&var2=bar#jumpHere.
Since we're talking about the hash (#), it's usually used for jumping to a specific part of the page. Because of that, it won't reload the whole page. This is useful for web applications that move from one view to another using only AJAX. To make each view bookmarkable, JavaScript "saves" the state (what view you are on) using location.hash to the URL. The next time you open the URL, JavaScript reads it and loads the correct view. In HTML5 this is superseded by pushState.
1) Find the coordinates of the element on the page
2) window.scrollTo(x,y)
Its called an anchor tag.
Place this in your HTML.
<a name="name"></a>
If you call this URL, it will jump to that place.
html-file.html#name
See: http://www.w3schools.com/tags/tag_a.asp
You can use a named anchor to do this with HTML, without javascript. here is a link explaining this.
It is very simply done with id tag of differnt html elements
for eg :- an div element if it is having "footer" as its id and is placed at the bottom of the page then, http://url-address-to-thatpage.html#footer will load the page and scroll it too the footer. (adding the "#idoftheelement" after the page url)
It is also possible to load and scroll the page with javascript.
You need to create a named anchor within the page. This will have the result you're talking about, almost like creating a "bookmark" within a page. No javascript required.
First, create the anchor using the <a> tag with the name attribute specified (in this case, section1):
<a name="section1"></a>
Then, to link to that anchor from the same page, just use something like this:
Go to Section 1
If you're linking to that anchor from another page (in this case, mypage.html), append #section1 at the end of the url:
Go to Section 1 in MyPage.html
For more information, see here.
Another way to do it is with the "id" attribute if it's not an anchor tag you'd like to bookmark. For example:
<div id="bookmark1">Content...</div>
Then, you can link to it with an anchor tag like this:
Go to content
Or link to that spot on the page by appending a #bookmark1 to
http://yourwebsite.com/page#bookmark1