dracoblue.net

Referer with document.location is broken in Internet Explorer

When you have (this should be discussed anyways) code in your javascript application changing to a different website, you'll see something similar to that:

location.href = 'test.php';

If you want to retrieve the referer on the next page, this will not work anymore. This is a

known IE Bug and not fixed in IE 8.

For instance this in javascript:

location.href = 'test.php';

And this as test.php

echo $_SERVER['REFERER']; 

In this case, the output in IE will always be empty. In the other big browsers, it works like a charm.

But there is always, also this time, a workaround. Found at

web bugtrack.

If you use for all browsers such wrapper function:

function goto(url){
  location.href = url;
}

You just have to make it like that for the one browser:

function goto(url){
    var referLink = document.createElement('a');
    referLink.href = url;
    document.body.appendChild(referLink);
    referLink.click();
}

As you can see, it will create a link with exactly the refer link. And will properly work then.

In internet explorer, javascript by DracoBlue @ 08 Jul 2009 | 190 Words

SVN Unterschiede ohne echtes Update

Manchmal möchte man einfach wissen, wo genau was bei einem svn update

geändert werden wird und wie die Dateien danach aussehen werden. Dafür kann man diesen Befehl benutzen.

svn diff -r BASE:HEAD .

Das zeigt den Unterscheid zwischen den Dateien im Verzeichnis (BASE) und der allerletzten Revision im SVN Repository (das bedeutet das HEAD).

Zu dem Trick, habe ich noch zwei weitere.

Wenn man rausfinden mag, welche Dateien geupdated werden hilft dieser Befehl:

svn st -u

Das zeigt leider nicht die Dateien an, die conflicted werden, daher gibt es

diesen workaround:

svn merge --dry-run -r BASE:HEAD .

In subversion by DracoBlue @ 06 Jul 2009 | 115 Words

Generate diff svn update (some kind of dry run)

If you just want to figure out, what files

will be updated and exactly what will be changed you might use this command.

svn diff -r BASE:HEAD .

This will display the differences between current files in the directory (BASE) and the latest revision at the repository (indicated by HEAD).

Just for the record, here are some other useful hints.

If you just want to have all updated files:

svn st -u

This however does not display all conflicted files, so you might use

this workaround:

svn merge --dry-run -r BASE:HEAD .

In subversion by DracoBlue @ 06 Jul 2009 | 110 Words

Refreshing workspace to recover changes ... crash

Since I am using

lunareclipse-plugin + eclipse 3.2 for lua development, I sometimes face the problem (when my pc got switched off too early when trying to hibernate) that eclipse does nothing but crashing when I try to start it.

Log states something like that:

!ENTRY org.eclipse.core.resources 2 10035 2009-06-30 22:19:06.772
!MESSAGE The workspace exited with unsaved changes in the previous
session; refreshing workspace to recover changes.

... and crashs.

I managed to make it working again, by heading to the workspace directory.

workspace.metadata.plugins\org.eclipse.core.resources and removing the file

.snap.

In eclipse, lua by DracoBlue @ 30 Jun 2009 | 97 Words

DJson 1.6 released

Today I want to announce a new release of DJson. The 1.6 is now using a different method to create the cache-file, which allows running multiple djson-scripts (like filterscripts) at the same time.

Also it features a method to define own DJSONMAXSTRING (before include of djson), if you need really big content.

The internal djson cache allows a maximum of ~ 70 characters (255-filenamelength-keylength-170) for a value, if DJSON_MAX_STRING is set to just 255.

Head over to the official

DJson page or directly to the djson 1.6 download.

In djson, open source, pawn by DracoBlue @ 21 Jun 2009 | 94 Words

Page 23 - Page 24 - Page 25

Give something back

Were my blog posts useful to you? If you want to give back, support one of these charities, too!

Report hate in social media Campact e.V. With our technology and your help, we protect the oceans from plastic waste. Gesellschaft fur Freiheitsrechte e. V. The civil eye in the mediterranean

Recent Dev-Articles

Read recently

Recent Files

About