![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
name="<a href='#' onClick = 'javascript:editCategoryDimmershow123("+id +");'>"+category.name;+"</a>" |
#3
| |||
| |||
|
|
hi all, We r working on ERP sys and am doing crossBrowser compatibility. The problem is am not able to load one function by onClicking the refrence text . could u please help me out. The code is looking like this........ name="<a href='#' onClick = 'javascript:editCategoryDimmershow123("+id +");'>"+category.name;+"</a>" |
#4
| |||
| |||
|
|
prathap... (AT) gmail (DOT) com escribió: name="<a href='#' onClick = 'javascript:editCategoryDimmershow123("+id +");'>"+category.name;+"</a>" 1. Why '#'? Provide a valid alternative URL for the task or just get rid of the <a> tag. 2. Why 'javascript:'? The onclick attribute expects javascript code, not an URI. 3. Does it work if you remove the ";" character so you close the <a> tag? -- --http://alvaro.es- Álvaro G. Vicario - Burgos, Spain -- Mi sitio sobre programación web:http://bits.demogracia.com -- Mi web de humor al baño María:http://www.demogracia.com -- hi thanks for the reply actually |
#5
| |||
| |||
|
|
hi thanks for the reply actually i tried with href it was not working that's why i changed it. javascript: is for we r refering that function from another js file |
#6
| |||
| |||
|
|
On May 21, 11:02 am, prathap... (AT) gmail (DOT) com wrote: hi all, We r working on ERP sys and am doing crossBrowser compatibility. The problem is am not able to load one function by onClicking the refrence text . could u please help me out. The code is looking like this........ name="<a href='#' onClick = 'javascript:editCategoryDimmershow123("+id +");'>"+category.name;+"</a>" Reason: http://groups.google.com/group/comp....718930ba71d113 Proper way: var lnk = document.createElement('A'); lnk.appendChild(document.createTextNode(category.n ame)); lnk.href = category.name; lnk.args = { 'id' : id, // other params if needed}; lnk.title = popup.helpPrompt // optional lnk.onclick = editCategoryDimmershow123; // ... yourContainer.appendChild(lnk); with editCategoryDimmershow123 like editCategoryDimmershow123(e) { if ((typeof event == 'object') && ('returnValue' in event)) { event.cancelBubble = true; event.returnValue = false; } else { e.stopPropagation(); e.preventDefault(); } var id = this.args.id; // do the rest } There are other ways as well but this seems the most flexible in relevance of the arguments. |
|
'; |
|
'; |
![]() |
| Thread Tools | |
| Display Modes | |
| |