javascript - Get iframe URL with php or js in ajax mvc -


i started learn php , js 2 weeks ago , trying familiar writing simple comment system in pure php/js without libraries (no jquery/laravel, etc.) how things works. sorry dumb question.

i stucked following issue. need url of page calling php app via iframe. mvc app , iframe includes index.php file.

it works fine with$_server['http_referer'], when run same php script ajax request index.php url (and not url need).

i tired url js

document.getelementbyid("iframe_id").contentwindow.location.href window.location.href  

but fails well. suppose issue js executes php base file i.e. index.php , pure php request starts on page loading iframe correct url.

the way see @ moment executing script on load write url dom/file/db/json grab data work on ajax requests , delete data, complex h**l. maybe there better solutions?


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -