• hello! I think this one is tricky … I wanted to add an opentable link to an existing menu item – the link I got looks like this (had to anonymize it – I tested to original, it works) :

    <a href="javascript:void(window.open('https://www.bookarestaurant.com/widget/BookingWidgetView/5361/‘xxx/3/de-DE?PrimaryTextColour=000000&SecondaryTextColour=000000&WidgetBackgroundColour=ffffff&PrimaryWidgetColour=3d5a6a&BackNavigationButtonsColour=a1a7aa&SelectableOptionsColour=899194&CalAvailableDateColour=000000&CalBGAvailableColour=899194&CalBGUnAvailableColour=ffffff&CalUnAvailableDateColour=a1a7aa&CalendarHeaderTextColor=899194&CalendarHeaderGridColour=2a4351&FontName=Arial%2c+Helvetica%2c+sans-serif&HeaderImage=%2fresources.ashx%2fRestaurantImages%2fSMxzeYyM8kKFCbdaEPzo2w.75.400.75.400.100%2fImage%2f0AC3BF9399F97758358C37E680293FB6%2fxxx.png&WidgetSpritesID=2&BARLogoID=4&isSpecialRequestsRequired=False&IsAvTimeSlot=False&MinPartySize=1&MaxPartySize=12&IsHideRestaurantTitle=True&IsShowTermsAndConditions=False','_blank','height=600, width=400, toolbar=no,location=no,resizable=no,menubar=no,scrollbars=yes'))">make a booking</a>

    First I thought it would be easy just had to add the href attributes via js like this:

    jQuery(document).ready(function($) {
       $('li#menu-item-54 a').attr('href','<strong>https://www.google.com</strong>');
    });

    I left the custom link “reservations” in the backend empty by the way.

    But it seems more complicate because the opentable url contains variables … it throws the error “Uncaught SyntaxError: missing ) after argument list”

    I tried many things, like the jin plugin, just copying the href attributes won’t do … thanks for your ideas and hints in advance!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How to add an OpenTable link to an existing menu item – window.open …’ is closed to new replies.