| | |
how to change the the value of src in <embed> using javascript
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Dec 2004
Posts: 27
Reputation:
Solved Threads: 0
need help here. how can i change the src in <embed> using javascript that works in firefox?
ex.
- how can i change "music.mid" to another midi file.
ex.
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<embed src="music.mid">
- how can i change "music.mid" to another midi file.
•
•
Join Date: Dec 2004
Posts: 1,655
Reputation:
Solved Threads: 35
First, I don't work much with embeds, so this is speculation. But you need to give your element an ID, as such:
Then, you can get to the object using
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<embed id="myMidi" src="music.mid">
document.getElementById("myMidi"). At that point, try simply changing the source: JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
document.getElementById("myMidi").src = "newfile.mid";
![]() |
Similar Threads
- embed javascript in php (PHP)
- "<SCRIPT SRC>" javascript logon help (JavaScript / DHTML / AJAX)
- change image one by one (ASP)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Copy text to clipboard
- Next Thread: Change left-border of a table cell with javascript
| Thread Tools | Search this Thread |
acid2 ajax ajaxcode ajaxexample ajaxhelp ajaxjspservlets animate automatically beta browser bug checkbox close codes createrange() css cursor debugger decimal dependent disablefirebug dom download dropdown editor element engine enter error events explorer ext file firefox form forms frameworks getselection google gwt gxt hiddenvalue highlightedword hint html htmlform ie7 ie8 iframe index internet java javascript javascripthelp2020 jawascriptruntimeerror jquery jsf jsfile jsp jump listbox maps masterpage math media menu microsoft mp4 object onmouseoutdivproblem onreadystatechange paypal pdf php player position programming progressbar prototype redirect regex runtime safari scale scriptlets search security select size software sql text textarea unicode w3c window windowofwords windowsxp wysiwyg \n






