Tell me, please, what could be the problem.

There is a static page with two links. The page uses the popular fancybox script. On the first link, the video does not open, on the second it opens. In the source page both links are working. When clicking is not the first link in the console, an error appears with a distorted address

    1 answer 1

    When you call FancyBox, you change the link on RegExp yourself. Watch carefully the parameters of the FancyBox call, there is a line:

     'href' : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'), 
    • I just did with this line. It does not affect it in any way - cyklop77
    • It even affects. Comment out in FIG. - istem
    • @Sergey Kalinin, do you specifically use links on youtube of different lengths? - Gena Tsarinny
    • I tried to comment out, and use no replay, and much more. truth does not affect. cache dumped. in the browser, in the cmf I use links of different lengths without intent. The first is the customer reference. took the second one for example - cyklop77
    • Judging by the fact that the final link has instead of watch? V = v /, the regular expression works, which means it is a problem. - Gena Tsarinny