My favorites | Sign in
Project Home Downloads Issues
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 47: base tag breaks DOM Element (hidden div) from working
2 people starred this issue and may be notified of changes. Back to list
Status:  WontFix
Owner:  ----
Closed:  Jan 2009


 
Project Member Reported by william....@gmail.com, Jul 14, 2008
What steps will reproduce the problem?
1. include a base tag in your html (make sure the path is correct)
example: 
<base href="C:\Documents and 
Settings\wac84s\Desktop\dump\jquery\nyromodal\nyroModal-1.2.8
\pass_params\" ></base>
2. paste this code onto the page
<a href="#test" class="nyroModal">DOM Element (hidden div)</a>
<div id="test" style="display: none; width: 600px;">
  <a href="demoSent.php" class="nyroModal">Open a new modal</a><br />
  Test
</div>

3. click the link 'DOM Element (hidden div)'

What is the expected output? What do you see instead?
The content of the div in the modal should appear but it says cannot be 
found.  this is because it takes what ever the url is in the base tag, for 
example: www.google.com and then inserts the '#test' so you 
get 'www.google.com#test' which is wrong if your page is for example 
should be: www.google.com/helloworld.jsp#test 

What version of the product are you using? On what operating system?
nyroModal-1.2.8
Windows IE 6

Please provide any additional information below.
See attached file for reproduction and my fix using the urlplugin. I image 
you would want to fix this in the core, but I just wanted to demonstrate 
the issue. 

NOTE: I left in some alerts so you can see what is happening

When you run the 'no_base_tag.html' the type setting is '#test'
When you run the 'base_tag.html' the type setting is 'undefined'
 
nyro_basetag_bug.zip
52.7 KB   Download
Jul 14, 2008
Project Member #1 william....@gmail.com
i am not sure what is happening but in my sandbox I sent you my parameter looks like 
this 
<a href="?&NYRO_type=%23test&NYRO_width=900&#test" class="nyroModal">DOM Element 
(hidden div) with type specified</a>
but gets tranlated some how correctly to #test

when I do it inside my app which is a mess of struts2,dojo and dwr js its does not 
and I have to make my url like this(notice I had to chagne the %23 to #)
<a href="?&NYRO_type=#test&NYRO_width=900&#test" class="nyroModal">DOM Element 
(hidden div) with type specified</a>

This is not your bug, but just incase the files I sent done work change the 
'%23' in the url 
to
'#'
and see if that works.

Jul 23, 2008
#2 Epo...@gmail.com
you can use php to fix that.
eg. href="<?php print $self ;?>#"

where $self =  $_SERVER['REQUEST_URI'];
Jan 26, 2009
Project Member #3 nyro...@gmail.com
After a small investigation, I think nyroModal works properly.
Maybe not the way you excpeted, but properly, regarding what you've done.
Here is some explanations :

NO BASE TAG
In the page http://domain.com/page.html I'm using nyromodal.
In a nyroModal link, I'm using the href="#div" which means the full URL will be
http://domain.com/page.html#div
It's working great and the content is shown through DOM element.

WITH BASE TAG
In the page http://domain.com/page.html I'm using nyromodal.
I'm also writing <base href="http://domain.com/"></base>
In a nyroModal link, I'm using the href="#div" which means the full URL (with the
base tag) will be http://domain.com/#div
So nyroModal detects it's not the same page and load the page trhough an Ajax call.

It seems pretty logiciel to me, isnt'it?

So, as Ephcj said, you should write href="page.html#div" for your link.
It'll make nyroModal work and the link will be again the good one.

For this reason, this bug (which is not one to me) won't be fixed.
Status: WontFix
Labels: -Type-Defect Type-Other

Powered by Google Project Hosting