Click here to Skip to main content
15,905,420 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I want to slide some photos in fancybox but its provide error "Failed to execute 'pushState' on 'History'" in browser console. same thing i tried in another page then its worked.

HTML
<ItemTemplate>
    <a class="fancybox" data-fancybox="gallery<%# Container.DataItemIndex + 1 %>" href="<%# Eval("order_image").ToString().Replace("~", "") %>">
           <img src="<%# Eval("order_image").ToString().Replace("~", "") %>" alt="" />
    </a>
    <a class="fancybox" data-fancybox="gallery<%# Container.DataItemIndex + 1 %>" href="<%# Eval("order_image1").ToString().Replace("~", "") %>"></a>
    <a class="fancybox" data-fancybox="gallery<%# Container.DataItemIndex + 1 %>" href="<%# Eval("order_image2").ToString().Replace("~", "") %>"></a>
</ItemTemplate>


Browser error blow

Uncaught DOMException: Failed to execute 'pushState' on 'History': A history state object with URL 'http://user/collectiondetailsa3search.aspx#gallery2-1' cannot be created in a document with origin 'http://127.0.0.1:85' and URL 'http://127.0.0.1:85//user/collectiondetailsa3search.aspx'.
at HTMLDocument.beforeMove.fb (http://127.0.0.1:85/Contents/Fancy/dist/jquery.fancybox.min.js:12:12791)
at HTMLDocument.dispatch (https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js:3:10316)
at HTMLDocument.q.handle (https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js:3:8343)
at Object.trigger (https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js:4:5628)
at HTMLDivElement.<anonymous> (https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js:4:6138)
at Function.each (https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js:2:2715)
at r.fn.init.each (https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js:2:1003)
at r.fn.init.trigger (https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js:4:6114)
at p.trigger (http://127.0.0.1:85/Contents/Fancy/dist/jquery.fancybox.min.js:11:21346)
at p.jumpTo (http://127.0.0.1:85/Contents/Fancy/dist/jquery.fancybox.min.js:11:8274)

What I have tried:

same thing i tried in another page then its worked

HTML
<div>
    <a class="fancybox" data-fancybox="gallery" href="StyleImages/02708964-a78d-409b-872f-fe1c88c6781a.jpg">img1</a>
    <a class="fancybox" data-fancybox="gallery" href="StyleImages/1b16d363-4fe3-4f62-b541-8b5dbd0e31e5.jpg"></a>
    <a class="fancybox" data-fancybox="gallery" href="StyleImages/326c010d-a525-43ac-b39f-0c66488dff50.jpg">img1</a>
    <a class="fancybox" data-fancybox="gallery2" href="StyleImages/02708964-a78d-409b-872f-fe1c88c6781a.jpg">img1</a>
    <a class="fancybox" data-fancybox="gallery2" href="StyleImages/d910356a-cccb-4cec-8b19-0dab468d8b6a.jpg">img1</a>
</div>
Posted
Updated 29-Apr-17 17:15pm
Comments
F-ES Sitecore 20-Apr-17 5:35am    
View the source of the page and see how the one that doesn't work differs from the one that does.
Abhilask kumar 20-Apr-17 21:30pm    
I'm not find problem than i ask question. Both's page view here.

1 solution

I not solved this but instead of this i used jquery dialog box and put image on dialog div.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900