function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AbAb 

Html a tag doesnot redirect on click

Hello,

When i click on "Here", I am not redirected to the google page.

<a href="https://www.google.fr/">Here</a>

However, when i copy the link address and paste and go in other window, it works.

Thanks for suggestions.
Best Answer chosen by Ab
Arunkumar RArunkumar R
Yes right. But don't know why it's not working for you. Instead of href, why can't you try using commandlink?
 
<apex:page>
    <apex:form>
        <apex:commandLink action="https://www.google.fr/" >Here</apex:commandLink>
    </apex:form>
</apex:page>

All Answers

Vijay NagarathinamVijay Nagarathinam
Hi Sandrine,

Try the following code snippet, It will be work and redirect to google page.

<a href="http://www.google.com">Here</a>

Thanks,
Vijay
Arunkumar RArunkumar R
Hi Sandrine,

Your href code is working fine. If Pop-Up option asked in your browser, then allow it.

Here is the sample code,
 
<apex:page >
 <a href="https://www.google.fr/">Here</a> 
</apex:page>

Use target="_blank", if you want to open a page in new tab.
AbAb
Either way i use it doesnt work
Arunkumar RArunkumar R
Try in different browser, there is no issue in the above posted code.
AbAb
but it should work in all the browser, I am using google chrome
Arunkumar RArunkumar R
Yes right. But don't know why it's not working for you. Instead of href, why can't you try using commandlink?
 
<apex:page>
    <apex:form>
        <apex:commandLink action="https://www.google.fr/" >Here</apex:commandLink>
    </apex:form>
</apex:page>
This was selected as the best answer