문제

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);
}

도움이 되었습니까?

해결책

This is how you would do it in L4

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

URL::to might be different in L3

Tip: you should learn jQuery :) it will make your life easier

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top