Hello,

This is laravel. Please help me fix the quotation so that my program works.

<button type="button" onclick="window.location.href = 'route('pemesanan')';">Beli</button>

If I click Beli (buy) it should run pemesanan (order) route. I don't think the route works correctly. please help me fix the quotation around the route. Thanks in advance.

Add backslashes before apostrophes onclick="window.location.href='route(\'pemesanan\')';" if you have to pass string pemesanan or add plus onclick="window.location.href='route('+pemesanan+')';" if "pemesanan" is javascript (number or object) variable name
or put both if it string variable name onclick="window.location.href='route(\''+pemesanan+'\')';"

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.