0

私はlaravel 3で作業しています。ポップアップモーダルを開くアクションボタンがあります。

デバイスのリストがあります。最初のページには、ポップアップモーダルがありました。しかし、2 ページ目では、ポップアップ モーダルは表示されませんが、最初のページにリダイレクトされます。

index.blade.php コード:

{{ HTML::link("devices#openProfile", "Impose Profile", array("id"=>$deviceid,"class"=>"btnSkyBlue","onclick"=>"openImposeProfile($device->id) )")) }}

JS:

function openImposeProfile(id) {
document.getElementById("openProfile").style.display="block";
var intentedId = document.getElementById("devId_profile");
意図されたId.value = id;
console.log("dev id: "+id+" | 意図: "+intentedId.value);
}

4

1 に答える 1

1

これは、L4で行う方法です

<a href="{{ URL::to('devices') }}#openProfile" id="{{ $deviceid }}" class="btnSkyBlue" onclick="openImposeProfile('{{ $device->id }}')">Impose Profile</a>

URL::to は L3 では異なる場合があります

ヒント: あなたは jQuery を学ぶべきです :) それはあなたの人生を楽にするでしょう

于 2013-09-05T15:09:55.097 に答える