Sha256: 3a4a7fdab7cd390ae4f2264aa535a3e8597bbfc73bb26cbc4f1986be464712f5

Contents?: true

Size: 564 Bytes

Versions: 10

Compression:

Stored size: 564 Bytes

Contents

<%# Locals: url %>
<script type="text/javascript">
  var url = <%= url.to_json %>;
  var hash = document.location.hash;

  // Remove leading # from the fragment
  if (hash.charAt(0) == '#') {
    hash = hash.substr(1);
  }

  // Remove leading / from the fragment if the URL already ends in a /
  // This prevents double-slashes.  Note we can't just replace all
  // double-slashes because the protocol includes //.
  if (url.charAt(url.length - 1) == '/' && hash.charAt(0) == '/') {
    hash = hash.substr(1);
  }

  document.location.href = url + hash;
</script>

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ajax-1.0.8 app/views/ajax/_redirect_with_fragment.html.erb
ajax-1.0.7 app/views/ajax/_redirect_with_fragment.html.erb
ajax-1.0.6 app/views/ajax/_redirect_with_fragment.html.erb
ajax-1.0.5 app/views/ajax/_redirect_with_fragment.html.erb
ajax-1.0.4 app/views/ajax/_redirect_with_fragment.html.erb
ajax-1.0.3 app/views/ajax/_redirect_with_fragment.html.erb
ajax-1.0.2 app/views/ajax/_redirect_with_fragment.html.erb
ajax-1.0.1 app/views/ajax/_redirect_with_fragment.html.erb
ajax-0.1.7 app/views/ajax/_redirect_with_fragment.html.erb
ajax-0.1.6 app/views/ajax/_redirect_with_fragment.html.erb