Created
June 25, 2014 17:16
-
-
Save nyaahara/4ce15bb88482a794fe1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var initial_values = link.attributes['initial_values']; // Initial value ( format JSON ) | |
// Add initial value. | |
initial_values = (initial_values)?JSON.parse('{'+initial_values.value+'}'):''; | |
for(var key in initial_values){ | |
var pattern = '['+key+']"'; | |
content = content.replace(pattern, pattern+' value="'+initial_values[key]+'"'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment