Click here to Skip to main content
14,603,637 members

JavaScript

 
QuestionRe: Adding Blank pages to PDF when requirements met Pin
Richard MacCutchan4-Apr-19 17:57
mveRichard MacCutchan4-Apr-19 17:57 
AnswerRe: Adding Blank pages to PDF when requirements met Pin
Member 142140864-Apr-19 18:07
MemberMember 142140864-Apr-19 18:07 
GeneralRe: Adding Blank pages to PDF when requirements met Pin
Richard MacCutchan5-Apr-19 5:10
mveRichard MacCutchan5-Apr-19 5:10 
Questionprint array json in dinamic table <html> Pin
serenimus29-Mar-19 11:15
Memberserenimus29-Mar-19 11:15 
AnswerRe: print array json in dinamic table <html> Pin
Richard MacCutchan29-Mar-19 22:29
mveRichard MacCutchan29-Mar-19 22:29 
GeneralRe: print array json in dinamic table <html> Pin
serenimus29-Mar-19 22:50
Memberserenimus29-Mar-19 22:50 
GeneralRe: print array json in dinamic table <html> Pin
Richard MacCutchan29-Mar-19 23:28
mveRichard MacCutchan29-Mar-19 23:28 
GeneralRe: print array json in dinamic table <html> Pin
serenimus30-Mar-19 8:27
Memberserenimus30-Mar-19 8:27 
Hi again!!

thanks for your reply, so I put it down the proposal of a colleage from stackoverflow...there I posted the same question..

so the json array comes from the controller, filtered with json_encode();, this is the copy paste from the Chome debugger..so as you can see, I want to display the array of 9 positions in three
rows one under other, and each with three cells..

0: "Naviera Riazor"
1: "La Coruña"
2: "La Coruña"
3: "Barcos Texeiro"
4: "La Coruña"
5: "La Coruña"
6: "Barcos de Vela Riazor"
7: "La Coruña"
8: "La Coruña"
length: 9


this is the table, with a script, that I dont know if is "key" so that everything goes good..

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table id="tabdat" border=1 style="margin-top: 300px;">
<thead>
<tr>
<th>Nombre</th>
<th>Localidad</th>
<th>Provincia</th>
</tr>
</thead>
<tbody></tbody>
</table>


</body>


and here is the function verDetalleNegocio(), that I invoke on the body with the onload method, inside I do the
loop, and try to display on the #tabdat, under...


function verDetalleNegocio(){
				
				var localidad=getLocalidad();
				var negocio=getNegocio();
				var datos={'loc':localidad,'neg':negocio};
				var datosS=JSON.stringify(datos);
				
				if(localidad!=="" && negocio!==""){
					
										
					$.ajax({
					type:"POST",
					data:"datos="+datosS,
					dataType:'json',
					cache:false,
					url:"<?=$this->basePath("web/negocios/detallenegocioajax")?>",
					success:function(datos){
					
					
					
					html = "";
					for(i=0; i<datos.length; i++){
					 html += "<tr>"
					 html += "<td>"+datos[i]+"</td>";
					 html += "<td>"+datos[i]+"</td>";
					 html += "<td>"+datos[i]+"</td>";
					 html += "</tr>";
					}
					$("#tabdat tbody").append(html);
				   
				   
				  
					
					}
					 
				});
					
				}else{
					return null;
				}				
			}




and finally the result that I obtain on the screen..as you can see, the information is displayed twice...please, tell me If i can put more infomation...thanksThumbs Up | :thumbsup:

Nombre Localidad Provincia
Naviera Riazor Naviera Riazor Naviera Riazor
La Coruña La Coruña La Coruña
La Coruña La Coruña La Coruña
Barcos Texeiro Barcos Texeiro Barcos Texeiro
La Coruña La Coruña La Coruña
La Coruña La Coruña La Coruña
Barcos de Vela Riazor Barcos de Vela Riazor Barcos de Vela Riazor
La Coruña La Coruña La Coruña
La Coruña La Coruña La Coruña
GeneralRe: print array json in dinamic table <html> Pin
Richard MacCutchan30-Mar-19 21:22
mveRichard MacCutchan30-Mar-19 21:22 
GeneralRe: print array json in dinamic table <html> Pin
serenimus2-Apr-19 8:02
Memberserenimus2-Apr-19 8:02 
GeneralRe: print array json in dinamic table <html> Pin
Richard MacCutchan3-Apr-19 4:47
mveRichard MacCutchan3-Apr-19 4:47 
QuestionChanging a font color Breaks my script??? Pin
Member 1420217628-Mar-19 9:04
MemberMember 1420217628-Mar-19 9:04 
AnswerRe: Changing a font color Breaks my script??? Pin
Richard MacCutchan28-Mar-19 22:42
mveRichard MacCutchan28-Mar-19 22:42 
AnswerRe: Changing a font color Breaks my script??? Pin
Richard MacCutchan29-Mar-19 5:56
mveRichard MacCutchan29-Mar-19 5:56 
QuestionJavascripts documentation engine and API Pin
Yuri_Cherkasov26-Mar-19 2:55
MemberYuri_Cherkasov26-Mar-19 2:55 
QuestionRegular Expression for min of 4 and max 40 characters in TypeScript Pin
simpledeveloper12-Mar-19 7:39
Membersimpledeveloper12-Mar-19 7:39 
AnswerRe: Regular Expression for min of 4 characters in TypeScript Pin
Richard MacCutchan12-Mar-19 7:54
mveRichard MacCutchan12-Mar-19 7:54 
GeneralRe: Regular Expression for min of 4 characters in TypeScript Pin
simpledeveloper12-Mar-19 8:22
Membersimpledeveloper12-Mar-19 8:22 
GeneralRe: Regular Expression for min of 4 characters in TypeScript Pin
Richard MacCutchan12-Mar-19 8:38
mveRichard MacCutchan12-Mar-19 8:38 
GeneralRe: Regular Expression for min of 4 characters in TypeScript Pin
simpledeveloper12-Mar-19 8:49
Membersimpledeveloper12-Mar-19 8:49 
GeneralRe: Regular Expression for min of 4 characters in TypeScript Pin
Richard MacCutchan12-Mar-19 9:51
mveRichard MacCutchan12-Mar-19 9:51 
GeneralRe: Regular Expression for min of 4 characters in TypeScript Pin
simpledeveloper13-Mar-19 6:29
Membersimpledeveloper13-Mar-19 6:29 
GeneralRe: Regular Expression for min of 4 characters in TypeScript Pin
Richard MacCutchan13-Mar-19 6:38
mveRichard MacCutchan13-Mar-19 6:38 
GeneralRe: Regular Expression for min of 4 characters in TypeScript Pin
simpledeveloper13-Mar-19 12:25
Membersimpledeveloper13-Mar-19 12:25 
GeneralRe: Regular Expression for min of 4 characters in TypeScript Pin
Richard MacCutchan13-Mar-19 22:16
mveRichard MacCutchan13-Mar-19 22:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.