I have added a wrapper to your html output and then written a jQuery code that you can use –
function embed_url() {
$dropdown_menu = '<select><option>OptionDefault</option><option value="?id=1">Option1<option value="?id=2">Option2</option></select>';
$full_url="<object type="text/html" data=" . $embed_this_url . ' style="width:100%; height:100%"><p> URL could not be loaded. </p> </object>';
return '<div class="site-url">' . $dropdown_menu . $full_url . '</div>';
}
jQuery code –
jQuery(document).ready(function($){
$('.site-url select').on('change', function(){
var param = $(this).val();
var url = $('.site-url object').attr('data');
url += param;
$('.site-url object').attr('data', url);
});
});
Related Posts:
- Dropdown menu on click change
- show-hide based on select option jquery wordpress
- how to show selected options drop down menu values in attributes field in after saving post.php
- force enqueue script to be first in order of prominence
- Modifying a JS file with data from plugin settings
- A better way to override plugin’s JS files?
- How can I reduce the amount of files loaded/included per plugin?
- How to call plugin path in JS?
- How do I sanitize a javascript text?
- How can a Firebase user registration and login be integrated into a WordPress site?
- How do I make my wordpress page more friendly for mobile viewers?
- AJAX Call Via Vanilla JavaScript In WordPress Plugin Development
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- How can I make content disappear when a user logs in?
- How to save Clicks of a download link button while it doesn’t matter if we refresh the page or again login/logout
- ‘Lazy loading’ list of posts with pagination
- Check javascript file Proper way in functions.php
- How to include admin-ajax when loading external javascript
- how would I include a js file with tags into wordpress?
- Dequeue / Deregister script and replace it with a new plugin
- Google Maps and Yandex Maps doesn’t work correctly
- Prevent CSS/JS loading when plugin is not used
- Creating an Exit Confirmation Popup
- How to create popup same as wordpress popup feature
- Gutenberg List Extension Block
- Localiztion in javascript
- prettyPhoto media loading very slowly in Chrome
- Pulling data from custom plugin settings using PHP shortcode and Javascript
- Using custom JS plugins with WordPress?
- Override Javascript in a Plugin?
- Change upload folder for a CPT
- Override Plugin Script Fucnction in WordPress
- add input in custom javascript from WordPress pages/posts
- Redux Framework: Page freezes on typing in Editor
- Using window.onload with Ubermenu
- Is there a loading priority for login_enqueue_scripts?
- Delay JavaScript files from loading
- “Conflict” with jQuery (or its plugins)?
- How to execute a plugin on a single page only?
- MediaElement.js works on one site but not the other?
- Pass user role to javascript code inside body
- How to get specific string/value from an array? php [closed]
- Access post title from custom meta box on title change
- Background Music WP [closed]
- Why does my jQuery plugin show up as text in WordPress?
- Adding a simple Javascript file with a plugin
- Social share buttons text shows up on post excerpts
- CSS/JS files in WordPress
- How do I override all stylesheets and scripts without a plugin
- Plugin Admin panel checkbox unchecked after submit
- Custom Plugin scripts from admin working in frontend
- Send Array from JS to php file then insert it in wp database through a plugin
- Gutenberg: Prevent links from being clickable in the block. Error: “Cannot destructure property ‘frameElement’ of ‘r’ as it is null.”
- How to override Plugin javascript function : $(‘body’).on(‘change’,’.class’)
- Connect / Login WordPress Hosted Website or Blog with NodeJs
- Elementor: How to design Dropdown Select Box Navigation page like Chegg
- login form should redirect to register page for in 1st login next time it should redirected to home page
- Javascript embedded disappears for editors
- How to fetch WordPress database values in JavaScript widget
- Possible way of having multiple Gutenberg instances for a page?
- Woocommerce add products to cart
- Show popup on click
- How to properly enqueue jQuery knob on WordPress without conflict?
- Javascript not getting injected into page
- Why does my custom plugin only function correctly once per page?
- How to get a specific string from a url
- Does anybody know how to insert a complete jquery plugin into a wordpress elementor-page?
- $wpdb not working wordpress plugin ajax call
- How can I create a secure file download in WordPress?
- Use AJAX to fetch Current Post Thumbnail for WordPress when Uploaded throughMedia Uploader Frontend
- WordPress site hamburger menu toggle not working
- Load google font script based on optgroup label selected
- Problem with wordpress has_action() function
- Woocommerce – Change variations output
- How to disable/enable PHP plugin functionality based on a TinyMCE toggle-button
- WordPress ajax error 400 bad request for sending data to remote site [duplicate]
- Customizer preview URL not updating when settings reset to default
- how to send two forms with one click (script ninjaforms id)
- wp_enqueue_scrpts seems not to get called
- Link in navigation menu send user to different page if mobile?
- Speed issues because of CSS & JavaScript
- How to limit each front-end user to view just his own uploaded files on Amazon S3?
- How to create a dashboard for logged-in users with custom functionality? [closed]
- Creating a user ‘add custom field’ section
- Javascript not working
- Creating custom URL for async content
- Need to hide an element depending on date and post category
- How do I convince this button to do something when it is clicked?
- Possible jquery / library conflict in plugin usage
- Why won’t the Comprehensive Google Map Plugin load?
- Plugin – including external javascript calling google maps
- Element works, but not on wordpress site [duplicate]
- how woocommerce swatch color name when hovered or selected
- How to create post comparison in wordpress
- WordPress shortcode plugin not working
- FacetWP: Plugin breaks button/modal functionality inside searchable content area
- TypeErrors with Yoast, jQuery in conflict?
- Javascript as Jquery Function Call?
- Count div with class (.length) only shows 0 [closed]
- Vanilla javascript in custom gutenberg block not working