Click here to Skip to main content
15,896,912 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to display a html page inside a another html page. i want to display inside in iframe tag when provide src to iframe then source can not find. my code is below:

$("#table11").find('tbody').append($('').append($('<iframe>').attr('src','~/iConsent/home.html'));

but when i run project and check source then i find source is: http://localhost:5059/~/iConsent/home.html but i want to get only ~/iConsent/home.html path how to remove remaining("http://localhost:5059") part. i pass ~/iConsent/home.html code behind to jquery code. please help
Posted

1 solution

~ (tilde) has no meaning on the client side!!! It's a server side sign used to identify the 'root' of the site...
You have to set source to something that have meaning on the client too like
'/iConsent/home.html'
'../../iConsent/home.html'
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900