0

I am working with laravel 3. I have an action button which will open a popup modal.

I have a list of devices. for first page, the popup modal was there. But for second page, the popup modal not coming out but it redirect back to the first page.

index.blade.php code:

{{ 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");
intentedId.value = id;
console.log("dev id: "+id+" | intended: "+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 回答