2
function closeMusic() {
                    var music = window.parent.document.getElementById("music");
                    music.style.display = "none";
                    var content = window.top.document.getElementById("content");
                    content.src = "../../bands/rrr/rrr.php";
                    }



<form class="delButton" id="delAlbButton" method="post" action="../../../../scripts/php/deletealbum.php">
                        <input type="hidden" value="'.$BN.'" id="BNforDel" name="BN"/>
                        <input type="hidden" value="'.$AN.'" id="ANforDel" name="AN"/>
                        <input type="submit" onClick="closeMusic();" value="DEL">
</form>

по нажатию вызывается скрипт удаления этой страницы

и js ф-я, которая вдругой iframe подгружает страницу

выдаёт Failed to load resource: the server responded with a http://localhost/bands/rrr/rrr.php status of 404 (Not Found)

путь точно верный указан

хотя тот что выдаёт и нужный различные

нужный http://localhost/NetFM/bands/rrr/rrr.php

помогите пожалуйста, в чём проблема?

1 ответ 1

2

Вместо onClick="closeMusic();" используй onsubmit.

var form = document.getElementById('delAlbButton');

form.onsubmit = function(){
  closeMusic();
}

использование абсолютный путь (absolute path) для URL.

content.src = "http://localhost/NetFM/bands/rrr/rrr.php";

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.